diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2019-03-15 10:46:11 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2019-03-15 10:46:11 +0100 |
commit | c544fcc7a30d9a934b0f8d098e000259e8b9ed62 (patch) | |
tree | fcbcb77b6f3e32a9b1d835e1b6166b77b0c082cf /initd/supervisor.c | |
parent | 5b106abaed0559aa73c78becca5e08ab0d00e85e (diff) |
initd: store completed services in list instead of deleting them
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'initd/supervisor.c')
-rw-r--r-- | initd/supervisor.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/initd/supervisor.c b/initd/supervisor.c index c9b08fd..3ed0ec7 100644 --- a/initd/supervisor.c +++ b/initd/supervisor.c @@ -7,6 +7,7 @@ static int target = -1; static service_t *running = NULL; static service_t *terminated = NULL; static service_t *queue = NULL; +static service_t *completed = NULL; static int singleshot = 0; static bool waiting = false; @@ -15,7 +16,8 @@ static int start_service(service_t *svc) svc->pid = runsvc(svc); if (svc->pid == -1) { print_status(svc->desc, STATUS_FAIL, false); - delsvc(svc); + svc->next = completed; + completed = svc; return -1; } @@ -59,7 +61,8 @@ static void handle_terminated_service(service_t *svc) target_completed(target); break; } - delsvc(svc); + svc->next = completed; + completed = svc; } void supervisor_handle_exited(pid_t pid, int status) |