From 5cf9e79ca7a28376c7645271136eb2cbb30dc5bc Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 18 Sep 2013 22:58:11 +0200 Subject: startup: do not pass signals on to the child Formerly /hurd/startup would forward all signals to the child it started (e.g. /libexec/runsystem). The motivation for doing so is not revealed in the comments, nor it is mentioned in the history of the version control system. This patch removes the forwarding of signals to the child. * startup/startup.c (process_signal): Do not pass signals on to the child. * startup/stubs.c: Remove file. * startup/Makefile: Remove stubs.c. --- startup/startup.c | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'startup/startup.c') diff --git a/startup/startup.c b/startup/startup.c index 29269a6d..4c91d4cf 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -904,9 +904,6 @@ frob_kernel_process (void) static pid_t child_pid; /* PID of the child we run */ static task_t child_task; /* and its (original) task port */ -error_t send_signal (mach_port_t msgport, int signal, mach_port_t refport, - mach_msg_timeout_t); - static void launch_something (const char *why); @@ -965,52 +962,6 @@ process_signal (int signo) } } } - else - { - /* Pass the signal on to the child. */ - task_t task; - error_t err; - - err = proc_pid2task (procserver, child_pid, &task); - if (err) - { - error (0, err, "proc_pid2task on %d", child_pid); - task = child_task; - } - else - { - mach_port_deallocate (mach_task_self (), child_task); - child_task = task; - } - - if (signo == SIGKILL) - { - err = task_terminate (task); - if (err != MACH_SEND_INVALID_DEST) - error (0, err, "task_terminate"); - } - else - { - mach_port_t msgport; - err = proc_getmsgport (procserver, child_pid, &msgport); - if (err) - error (0, err, "proc_getmsgport"); - else - { - err = send_signal (msgport, signo, task, - 500); /* Block only half a second. */ - mach_port_deallocate (mach_task_self (), msgport); - if (err) - { - error (0, err, "cannot send %s to child %d", - strsignal (signo), child_pid); - err = task_terminate (task); - if (err != MACH_SEND_INVALID_DEST) - error (0, err, "task_terminate"); - } - } - } - } } /* Start the child program PROG. It is run via /libexec/console-run -- cgit v1.2.3