mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
Merge pull request #160 from troglobit/release
Forward port dirty vs enabled fixes from release branch
This commit is contained in:
3 files changed
+13
-4
No files matched your search
@@ -458,7 +458,7 @@ void svc_mark_dynamic(void)
|
||||
if (svc->protect)
|
||||
continue;
|
||||
|
||||
*((int *)&svc->dirty) = -1;
|
||||
*((int *)&svc->removed) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,6 +472,11 @@ void svc_mark_clean(svc_t *svc)
|
||||
*((int *)&svc->dirty) = 0;
|
||||
}
|
||||
|
||||
void svc_enable(svc_t *svc)
|
||||
{
|
||||
*((int *)&svc->removed) = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* svc_clean_dynamic - Stop and cleanup stale services removed from /etc/finit.d
|
||||
* @cb: Callback to run for each stale service
|
||||
@@ -484,7 +489,7 @@ void svc_clean_dynamic(void (*cb)(svc_t *))
|
||||
svc_t *svc, *iter = NULL;
|
||||
|
||||
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) {
|
||||
if (svc->dirty == -1 && cb)
|
||||
if (svc->removed && cb)
|
||||
cb(svc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user