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 <timo.t.kokkonen@iki.fi>
-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;
static int grant_new_job(void)
{
int ret;
-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,
struct event_handler job_request_handler = {
.handle_event = handle_job_request,
.events = EPOLLIN,
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGCHLD);
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;
if (max_jobs_requested > 0) {
max_jobs = max_jobs_requested;
goto no_count_cpus;