externalpipe: ensure all of st's children are reaped
This commit is contained in:
parent
315c5cbe9f
commit
8faa9f3c93
1 changed files with 11 additions and 0 deletions
11
st.c
11
st.c
|
|
@ -789,8 +789,19 @@ sigchld(int a)
|
|||
#endif // EXTERNALPIPEIN_PATCH
|
||||
die("waiting for pid %hd failed: %s\n", pid, strerror(errno));
|
||||
|
||||
#if EXTERNALPIPE_PATCH
|
||||
if (pid != p) {
|
||||
if (p == 0 && wait(&stat) < 0)
|
||||
die("wait: %s\n", strerror(errno));
|
||||
|
||||
/* reinstall sigchld handler */
|
||||
signal(SIGCHLD, sigchld);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pid != p)
|
||||
return;
|
||||
#endif // EXTERNALPIPE_PATCH
|
||||
|
||||
#if EXTERNALPIPEIN_PATCH && EXTERNALPIPE_PATCH
|
||||
close(csdfd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue