diff options
author | cracauer <cracauer@FreeBSD.org> | 1998-09-10 22:09:11 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 1998-09-10 22:09:11 +0000 |
commit | 62616a44cfb0ebcda627090e0f957e34c66ad16b (patch) | |
tree | c3839c37196d905c6e8d9337ec9e88e820fd530e /bin/sh/trap.c | |
parent | e573989d4559a29b4189808bf98c7df867eaccf2 (diff) | |
download | FreeBSD-src-62616a44cfb0ebcda627090e0f957e34c66ad16b.zip FreeBSD-src-62616a44cfb0ebcda627090e0f957e34c66ad16b.tar.gz |
Narrow down conditions to break wait() to process traps.
Improve comments.
Diffstat (limited to 'bin/sh/trap.c')
-rw-r--r-- | bin/sh/trap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/sh/trap.c b/bin/sh/trap.c index 666284c..fd359fc 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95"; #endif static const char rcsid[] = - "$Id: trap.c,v 1.15 1998/09/08 13:16:52 cracauer Exp $"; + "$Id: trap.c,v 1.16 1998/09/10 14:51:06 cracauer Exp $"; #endif /* not lint */ #include <signal.h> @@ -364,10 +364,11 @@ onsig(signo) if ((signo == SIGINT || signo == SIGQUIT) && in_waitcmd != 0) breakwaitcmd = 1; /* - * If a trap is set, we need to make sure it is executed even - * when a childs blocks all signals. + * If a trap is set, not ignored and not the null command, we need + * to make sure traps are executed even when a child blocks signals. */ if (trap[signo] != NULL && + ! trap[signo][0] == '\0' && ! (trap[signo][0] == ':' && trap[signo][1] == '\0')) breakwaitcmd = 1; } |