svc: Remove svc_dynamic_iterator(), soon no difference between svc's

This is a prelude to a major behavioral change.  The difference between
a static and dynamic service will be removed in Finit v3.1.  This means
all .conf files, including /etc/finit.conf, will be re-read on reload.

However, not all configuration directives will be re-read, some will
only be applicable at bootstrap, i.e. runlevel S.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-12-20 09:04:14 +01:00
parent a9456cec41
commit f3669c7537
2 changed files with 4 additions and 27 deletions
+4 -26
View File
@@ -141,28 +141,6 @@ svc_t *svc_inetd_iterator(svc_t *iter)
}
/**
* svc_dynamic_iterator - Naive iterator over all registered dynamic services.
* @iter: %NULL for first entry, use returned value for subsequent calls
*
* Returns:
* The first dynamically loaded &svc_t when %NULL is given as argument,
* otherwise the next dynamically loaded &svc_t until the end when %NULL
* is returned.
*/
svc_t *svc_dynamic_iterator(svc_t *iter)
{
svc_t *svc;
for (svc = svc_iterator(iter); svc; svc = svc_iterator(svc)) {
if (svc->mtime.tv_sec)
return svc;
}
return NULL;
}
/**
* svc_named_iterator - Iterates over all instances of a service.
* @iter: %NULL for first entry, use returned value for subsequent calls
@@ -364,11 +342,11 @@ svc_t *svc_find_by_nameid(char *name, int id)
*/
void svc_mark_dynamic(void)
{
svc_t *svc = svc_dynamic_iterator(NULL);
svc_t *svc = svc_iterator(NULL);
while (svc) {
*((int *)&svc->dirty) = -1;
svc = svc_dynamic_iterator(svc);
svc = svc_iterator(svc);
}
}
@@ -402,14 +380,14 @@ void svc_check_dirty(svc_t *svc, struct timeval *mtime)
*/
void svc_clean_dynamic(void (*cb)(svc_t *))
{
svc_t *svc = svc_dynamic_iterator(NULL);
svc_t *svc = svc_iterator(NULL);
while (svc) {
if (svc->dirty == -1 && cb) {
cb(svc);
svc_mark_clean(svc);
}
svc = svc_dynamic_iterator(svc);
svc = svc_iterator(svc);
}
}
-1
View File
@@ -139,7 +139,6 @@ svc_t *svc_find_by_nameid (char *name, int id);
svc_t *svc_iterator (svc_t *iter);
svc_t *svc_inetd_iterator (svc_t *iter);
svc_t *svc_dynamic_iterator (svc_t *iter);
svc_t *svc_named_iterator (svc_t *iter, char *cmd);
svc_t *svc_job_iterator (svc_t *iter, int job);