From 1447877af55f7a9491808a822c7bc6ca96700d53 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sat, 9 Jul 2016 14:09:40 +0300 Subject: [PATCH] process: Remove signal handler completely There is no need for this at all any more. This was only used for reaping the childs on the fork based concurrency management. Now that threads are doing forking on the same namespace, threads that are expecting signals might get confused when the main thread handles the sigchld signal on behalf of the thread. Remove the handler completely to avoid any confusion. Signed-off-by: Timo Kokkonen --- process.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/process.c b/process.c index ae13277..fd87b1f 100644 --- a/process.c +++ b/process.c @@ -189,28 +189,6 @@ int get_parent_count(void) return parent_count; } -static int handle_signals(struct event_handler *h) -{ - struct signalfd_siginfo siginfo; - int ret; - - ret = read(h->fd, &siginfo, sizeof(siginfo)); - if (ret < sizeof(siginfo)) { - pr_err("Expected %zd from read, got %d: %m\n", - sizeof(siginfo), ret); - return -1; - } - - if (siginfo.ssi_signo != SIGCHLD) { - pr_err("Unexpected signal %d, ignoring\n", siginfo.ssi_signo); - return -1; - } - - harvest_zombies(siginfo.ssi_pid); - - return 0; -} - static int grant_new_job(void) { int ret; @@ -289,12 +267,6 @@ static int handle_job_request(struct event_handler *h) return 0; } -struct event_handler signal_handler = { - .handle_event = handle_signals, - .events = EPOLLIN, - .name = "signal", -}; - struct event_handler job_request_handler = { .handle_event = handle_job_request, .events = EPOLLIN, @@ -340,14 +312,6 @@ int init_jobcontrol(int max_jobs_requested) sigemptyset(&sigmask); sigaddset(&sigmask, SIGCHLD); - signal_handler.fd = signalfd(-1, &sigmask, SFD_CLOEXEC); - if (job_request_handler.fd < 0) { - pr_err("Failed to create signal_fd: %m\n"); - return -1; - } - - register_event_handler(&signal_handler); - if (max_jobs_requested > 0) { max_jobs = max_jobs_requested; goto no_count_cpus; -- 2.45.0