summaryrefslogtreecommitdiffstats
path: root/bin/sh/trap.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1998-09-10 14:51:06 +0000
committercracauer <cracauer@FreeBSD.org>1998-09-10 14:51:06 +0000
commit1d2e8c536790f09469b598e6d9cae37d6639d7d9 (patch)
tree46ab55fecdbf03c4d44e59ace86298d4509c1b9c /bin/sh/trap.c
parent30c8ef5ad9738a290fe79f0210327b2fd2763771 (diff)
downloadFreeBSD-src-1d2e8c536790f09469b598e6d9cae37d6639d7d9.zip
FreeBSD-src-1d2e8c536790f09469b598e6d9cae37d6639d7d9.tar.gz
Fix an inefficiency I introduced in my last commit.
Include "expand.h" vom memalloc.c to pull function declartion into scope
Diffstat (limited to 'bin/sh/trap.c')
-rw-r--r--bin/sh/trap.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/sh/trap.c b/bin/sh/trap.c
index 9cb3d0b..666284c 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.14 1998/08/25 09:33:34 cracauer Exp $";
+ "$Id: trap.c,v 1.15 1998/09/08 13:16:52 cracauer Exp $";
#endif /* not lint */
#include <signal.h>
@@ -347,7 +347,6 @@ void
onsig(signo)
int signo;
{
- int i;
#ifndef BSD
signal(signo, onsig);
@@ -368,13 +367,9 @@ onsig(signo)
* If a trap is set, we need to make sure it is executed even
* when a childs blocks all signals.
*/
- for (i = 0; i < NSIG; i++) {
- if (signo == i && trap[i] != NULL &&
- ! (trap[i][0] == ':' && trap[i][1] == '\0')) {
- breakwaitcmd = 1;
- break;
- }
- }
+ if (trap[signo] != NULL &&
+ ! (trap[signo][0] == ':' && trap[signo][1] == '\0'))
+ breakwaitcmd = 1;
}
OpenPOWER on IntegriCloud