diff options
author | 1997-06-22 23:18:55 +0000 | |
---|---|---|
committer | 1997-06-22 23:18:55 +0000 | |
commit | 0caf00bf3273c2770c2bb74973e6b896ab3b7386 (patch) | |
tree | 90a7c7beddc4f4f449cf31aa34a21fc922a49a2d /lib/libc/gen/popen.c | |
parent | Convert the find(1) examples to mandoc. (diff) | |
download | wireguard-openbsd-0caf00bf3273c2770c2bb74973e6b896ab3b7386.tar.xz wireguard-openbsd-0caf00bf3273c2770c2bb74973e6b896ab3b7386.zip |
Fix a bogon in last change
Diffstat (limited to 'lib/libc/gen/popen.c')
-rw-r--r-- | lib/libc/gen/popen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 414d61befdf..ccb2230ca51 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: popen.c,v 1.5 1997/06/22 20:01:48 tholo Exp $"; +static char rcsid[] = "$OpenBSD: popen.c,v 1.6 1997/06/22 23:18:55 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -93,12 +93,13 @@ popen(program, type) close(fileno(cur->fp)); if (*type == 'r') { + int tpdes1 = pdes[1]; + (void) close(pdes[0]); /* * We must NOT modify pdes, due to the * semantics of vfork. */ - int tpdes1 = pdes[1]; if (tpdes1 != STDOUT_FILENO) { (void)dup2(tpdes1, STDOUT_FILENO); (void)close(tpdes1); |