mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Another signal-handling refinement from RJK: the SIGCHLD handler
should be prepared to reap more than one child per invocation if necessary, since we do after all have two. [originally from svn r2183]
This commit is contained in:
parent
53eb272766
commit
d6739ada35
12
unix/pty.c
12
unix/pty.c
@ -168,11 +168,13 @@ static void sigchld_handler(int signum)
|
|||||||
pid_t pid;
|
pid_t pid;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
pid = waitpid(-1, &status, WNOHANG);
|
do {
|
||||||
if (pid == pty_child_pid && (WIFEXITED(status) || WIFSIGNALED(status))) {
|
pid = waitpid(-1, &status, WNOHANG);
|
||||||
pty_exit_code = status;
|
if (pid == pty_child_pid && (WIFEXITED(status) || WIFSIGNALED(status))) {
|
||||||
pty_child_dead = TRUE;
|
pty_exit_code = status;
|
||||||
}
|
pty_child_dead = TRUE;
|
||||||
|
}
|
||||||
|
} while(pid > 0);
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user