summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mail/popen.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c
index c54111d89c3..f29b3c47fe8 100644
--- a/usr.bin/mail/popen.c
+++ b/usr.bin/mail/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.19 1998/08/15 23:17:24 millert Exp $ */
+/* $OpenBSD: popen.c,v 1.20 1998/09/08 15:24:38 millert Exp $ */
/* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel 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.19 1998/08/15 23:17:24 millert Exp $";
+static char rcsid[] = "$OpenBSD: popen.c,v 1.20 1998/09/08 15:24:38 millert Exp $";
#endif
#endif /* not lint */
@@ -221,8 +221,8 @@ file_pid(fp)
* Run a command without a shell, with optional arguments and splicing
* of stdin and stdout. The command name can be a sequence of words.
* Signals must be handled by the caller.
- * "Mask" contains the signals to ignore in the new process.
- * SIGINT is enabled unless it's in the mask.
+ * "nset" contains the signals to ignore in the new process.
+ * SIGINT is enabled unless it's in "nset".
*/
/*VARARGS4*/
int
@@ -381,16 +381,16 @@ int
wait_child(pid)
int pid;
{
- struct child *cp = findchild(pid, 0);
+ struct child *cp;
sigset_t nset, oset;
- if (cp == NULL)
- return(-1);
-
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
sigprocmask(SIG_BLOCK, &nset, &oset);
+ if ((cp = findchild(pid, 0)) == NULL)
+ return(-1);
+
while (!cp->done)
sigsuspend(&oset);
wait_status = cp->status;
@@ -406,16 +406,16 @@ void
free_child(pid)
int pid;
{
- struct child *cp = findchild(pid, 0);
+ struct child *cp;
sigset_t nset, oset;
- if (cp == NULL)
- return;
-
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
sigprocmask(SIG_BLOCK, &nset, &oset);
+ if ((cp = findchild(pid, 0)) == NULL)
+ return;
+
if (cp->done)
delchild(cp);
else