summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1996-06-26 21:22:35 +0000
committerdm <dm@cvs.openbsd.org>1996-06-26 21:22:35 +0000
commit848864e943f4ed4943129ce0f69b28176221fc0f (patch)
tree9aefad8452787716ca0c5b5ce32d5f957113b3bc
parent9466e0cc2f1b76be3d36c9d6ac8b73ae6aebd9ec (diff)
Accept NULL nset in prepare child (as run_editor will try to use one).
-rw-r--r--usr.bin/mail/popen.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c
index 7cf344b74f6..7cdd016aee9 100644
--- a/usr.bin/mail/popen.c
+++ b/usr.bin/mail/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.2 1996/06/11 12:53:47 deraadt Exp $ */
+/* $OpenBSD: popen.c,v 1.3 1996/06/26 21:22:34 dm Exp $ */
/* $NetBSD: popen.c,v 1.4 1996/06/08 19:48:35 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: popen.c,v 1.2 1996/06/11 12:53:47 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: popen.c,v 1.3 1996/06/26 21:22:34 dm Exp $";
#endif
#endif /* not lint */
@@ -283,11 +283,13 @@ prepare_child(nset, infd, outfd)
dup2(infd, 0);
if (outfd >= 0)
dup2(outfd, 1);
- for (i = 1; i <= NSIG; i++)
- if (sigismember(nset, i))
- (void) signal(i, SIG_IGN);
- if (!sigismember(nset, SIGINT))
- (void) signal(SIGINT, SIG_DFL);
+ if (nset) {
+ for (i = 1; i <= NSIG; i++)
+ if (sigismember(nset, i))
+ (void) signal(i, SIG_IGN);
+ if (!sigismember(nset, SIGINT))
+ (void) signal(SIGINT, SIG_DFL);
+ }
sigfillset(&fset);
(void) sigprocmask(SIG_UNBLOCK, &fset, NULL);
}