sigemptyset(&sa.sa_mask);
/*
- * Signals for forward to the child process (excluding SIGALRM and SIGCHLD).
+ * Signals for forward to the child process (excluding SIGCHLD).
* Note: HP-UX select() will not be interrupted if SA_RESTART set.
*/
sa.sa_flags = SA_INTERRUPT; /* do not restart syscalls */
sa.sa_handler = handler;
+ sigaction(SIGALRM, &sa, NULL);
sigaction(SIGCHLD, &sa, NULL);
sigaction(SIGHUP, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
/* Handle signal from parent. */
switch (signo) {
- case SIGALRM:
- terminate_child(pid, TRUE);
- break;
case SIGUSR1:
/* Continue in foreground, grant it controlling tty. */
do {
if (pipe_nonblock(signal_pipe) != 0)
error(1, "cannot create pipe");
- /* Reset SIGWINCH and SIGALRM. */
+ /* Reset SIGWINCH. */
zero_bytes(&sa, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
sa.sa_handler = SIG_DFL;
sigaction(SIGWINCH, &sa, NULL);
- sigaction(SIGALRM, &sa, NULL);
/* Ignore any SIGTTIN or SIGTTOU we get. */
sa.sa_handler = SIG_IGN;