summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2004-12-02 13:12:43 +0000
committermaxim <maxim@FreeBSD.org>2004-12-02 13:12:43 +0000
commitd6497bbdb550b8e03d24e4803192282d7a150691 (patch)
treef8cff54862f4119a2dcf223c91d1f743b2ce79a5 /bin
parent62476e023e538a6a64b6dd8280e221c107590046 (diff)
downloadFreeBSD-src-d6497bbdb550b8e03d24e4803192282d7a150691.zip
FreeBSD-src-d6497bbdb550b8e03d24e4803192282d7a150691.tar.gz
o Terminate an endless loop sh -T goes into in dowait() around waitproc().
XXX from Tor: "The shell can also go into a similar loop if the child was killed by signal 127, since the shell would believe the child to have only stopped (WIFSTOPPED() macro returns nonzero value). Disallowing signals 127 and 128 will fix that problem." See kern/19402 for details. PR: bin/66242 Submitted by: tegge Analysis and testcase by: demon MFC after: 3 weeks
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/jobs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index 3c9ebea..8c19d22 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -926,7 +926,8 @@ dowait(int block, struct job *job)
in_dowait--;
if (breakwaitcmd != 0) {
breakwaitcmd = 0;
- return -1;
+ if (pid <= 0)
+ return -1;
}
if (pid <= 0)
return pid;
OpenPOWER on IntegriCloud