Clean up bootstrap-only tasks when leaving bootstrap 'S' runlevel

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-11-26 20:22:24 +01:00
1 parent 8df2b7b6e9
commit b4ccc8b008
4 files changed
+26 -3

No files matched your search

+18
View File
@@ -359,6 +359,24 @@ void svc_clean_dynamic(void (*cb)(svc_t *))
}
}
/**
* svc_clean_bootstrap - Remove bootstrap-only services after boot
* @svc: Pointer to &svc_t object
*
* Returns:
* %TRUE(1) if object was bootstrap-only, otherwise %FALSE(0)
*/
int svc_clean_bootstrap(svc_t *svc)
{
if (!ISOTHER(svc->runlevels, 0)) {
svc->pid = 0;
svc_del(svc);
return 1;
}
return 0;
}
char *svc_status(svc_t *svc)
{
if (svc->pid)