mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Minor refactor, new fn svc_mark()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -500,6 +500,14 @@ svc_t *svc_find_by_pidfile(char *fn)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void svc_mark(svc_t *svc)
|
||||
{
|
||||
if (!svc || svc->protect)
|
||||
return;
|
||||
|
||||
*((int *)&svc->removed) = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* svc_mark_dynamic - Mark dynamically loaded services for deletion.
|
||||
*
|
||||
@@ -514,12 +522,8 @@ void svc_mark_dynamic(void)
|
||||
{
|
||||
svc_t *svc, *iter = NULL;
|
||||
|
||||
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) {
|
||||
if (svc->protect)
|
||||
continue;
|
||||
|
||||
*((int *)&svc->removed) = 1;
|
||||
}
|
||||
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0))
|
||||
svc_mark(svc);
|
||||
}
|
||||
|
||||
void svc_mark_dirty(svc_t *svc)
|
||||
|
||||
Reference in New Issue
Block a user