If we get a signal other than SIGCHLD in the monitor, pass it directly
to the child.
This commit is contained in:
@@ -943,7 +943,6 @@ exec_monitor(struct command_details *details, char *argv[], char *envp[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FD_ISSET(signal_pipe[0], fdsr)) {
|
if (FD_ISSET(signal_pipe[0], fdsr)) {
|
||||||
/* Read child status. */
|
|
||||||
n = read(signal_pipe[0], &signo, sizeof(signo));
|
n = read(signal_pipe[0], &signo, sizeof(signo));
|
||||||
if (n == -1) {
|
if (n == -1) {
|
||||||
if (errno == EINTR || errno == EAGAIN)
|
if (errno == EINTR || errno == EAGAIN)
|
||||||
@@ -951,12 +950,16 @@ exec_monitor(struct command_details *details, char *argv[], char *envp[],
|
|||||||
warning("error reading from signal pipe");
|
warning("error reading from signal pipe");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
/* We should only ever get SIGCHLD. */
|
/*
|
||||||
if (signo == SIGCHLD) {
|
* Handle SIGCHLD specially and deliver other signals
|
||||||
|
* directly to the child.
|
||||||
|
*/
|
||||||
|
if (signo == SIGCHLD)
|
||||||
alive = handle_sigchld(backchannel, &cstat);
|
alive = handle_sigchld(backchannel, &cstat);
|
||||||
|
else
|
||||||
|
deliver_signal(child, signo);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (errpipe[0] != -1 && FD_ISSET(errpipe[0], fdsr)) {
|
if (errpipe[0] != -1 && FD_ISSET(errpipe[0], fdsr)) {
|
||||||
/* read errno or EOF from command pipe */
|
/* read errno or EOF from command pipe */
|
||||||
n = read(errpipe[0], &cstat, sizeof(cstat));
|
n = read(errpipe[0], &cstat, sizeof(cstat));
|
||||||
|
Reference in New Issue
Block a user