From 3db3b82a3081f6db3cbee8926db19c1c072cc7d5 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 13 May 2020 17:13:32 +0200 Subject: Cleanup: Remove SIGCHLD handler from initd Instead use wait() in the main loop. This way, the supervisor functions (except set target) are no longer called from signal context and can be simplified a little. Signed-off-by: David Oberhollenzer --- initd/supervisor.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'initd/supervisor.c') diff --git a/initd/supervisor.c b/initd/supervisor.c index 43900a5..5849b9c 100644 --- a/initd/supervisor.c +++ b/initd/supervisor.c @@ -180,23 +180,18 @@ out: bool supervisor_process_queues(void) { svc_run_data_t *rt; - sigset_t old_mask; service_t *svc; size_t count; - bool ret = false; - - cli(&old_mask); if (waiting) - goto out_unblock; + return false; count = queue_count[target]; if (queue_idx >= count) - goto out_unblock; + return false; rt = rt_data + queue_start[target] + queue_idx++; svc = rt->svc; - ret = true; if (svc->flags & SVC_FLAG_HAS_EXEC) { rt->pid = runsvc(rt->svc); @@ -222,7 +217,5 @@ bool supervisor_process_queues(void) print_status(svc->desc, rt->state); check_target_completion(); -out_unblock: - sti(&old_mask); - return ret; + return true; } -- cgit v1.2.3