diff options
| author | Mike Smith <msmith@FreeBSD.org> | 1998-10-15 01:47:40 +0000 |
|---|---|---|
| committer | Mike Smith <msmith@FreeBSD.org> | 1998-10-15 01:47:40 +0000 |
| commit | 26c51fb453bc1d2a482f487eead3e755452e463c (patch) | |
| tree | 6a11d938ccee87522bdcf58b87974bd390ef94b2 /lib/libc/gen/popen.c | |
| parent | d6e03c9b6dd1fa7d0fcbe386cf6414e1aa9aee79 (diff) | |
Notes
Diffstat (limited to 'lib/libc/gen/popen.c')
| -rw-r--r-- | lib/libc/gen/popen.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 86166711c2bf..bcbd16418493 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -65,6 +65,7 @@ popen(command, type) FILE *iop; int pdes[2], pid, twoway; char *argv[4]; + struct pid *p; /* * Lite2 introduced two-way popen() pipes using socketpair(). @@ -124,6 +125,9 @@ popen(command, type) } (void)close(pdes[1]); } + for (p = pidlist; p; p = p->next) { + (void)close(fileno(p->fp)); + } execve(_PATH_BSHELL, argv, environ); _exit(127); /* NOTREACHED */ |
