mirror of
https://github.com/troglobit/finit.git
synced 2026-11-02 13:20:32 +00:00
Minor refactor, new fn svc_mark()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
f796d59f77
commit
9cb6a54493
2 files changed
+11
-6
No files matched your search
@@ -500,6 +500,14 @@ svc_t *svc_find_by_pidfile(char *fn)
|
|||||||
return NULL;
|
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.
|
* svc_mark_dynamic - Mark dynamically loaded services for deletion.
|
||||||
*
|
*
|
||||||
@@ -514,12 +522,8 @@ void svc_mark_dynamic(void)
|
|||||||
{
|
{
|
||||||
svc_t *svc, *iter = NULL;
|
svc_t *svc, *iter = NULL;
|
||||||
|
|
||||||
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) {
|
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0))
|
||||||
if (svc->protect)
|
svc_mark(svc);
|
||||||
continue;
|
|
||||||
|
|
||||||
*((int *)&svc->removed) = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void svc_mark_dirty(svc_t *svc)
|
void svc_mark_dirty(svc_t *svc)
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ void svc_foreach_type (int types, int (*cb)(svc_t *));
|
|||||||
|
|
||||||
svc_t *svc_stop_completed (void);
|
svc_t *svc_stop_completed (void);
|
||||||
|
|
||||||
|
void svc_mark (svc_t *svc);
|
||||||
void svc_mark_dynamic (void);
|
void svc_mark_dynamic (void);
|
||||||
void svc_mark_dirty (svc_t *svc);
|
void svc_mark_dirty (svc_t *svc);
|
||||||
void svc_mark_clean (svc_t *svc);
|
void svc_mark_clean (svc_t *svc);
|
||||||
|
|||||||
Reference in new issue
Block a user