mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
externalpipe: ensure all of st's children are reaped
This commit is contained in:
parent
315c5cbe9f
commit
8faa9f3c93
11
st.c
11
st.c
@ -789,8 +789,19 @@ sigchld(int a)
|
|||||||
#endif // EXTERNALPIPEIN_PATCH
|
#endif // EXTERNALPIPEIN_PATCH
|
||||||
die("waiting for pid %hd failed: %s\n", pid, strerror(errno));
|
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)
|
if (pid != p)
|
||||||
return;
|
return;
|
||||||
|
#endif // EXTERNALPIPE_PATCH
|
||||||
|
|
||||||
#if EXTERNALPIPEIN_PATCH && EXTERNALPIPE_PATCH
|
#if EXTERNALPIPEIN_PATCH && EXTERNALPIPE_PATCH
|
||||||
close(csdfd);
|
close(csdfd);
|
||||||
|
Loading…
Reference in New Issue
Block a user