mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
FIxed the cleanup. I forgot to leave stdin alone in the usual (!twoway)
case.
This commit is contained in:
parent
9081eec1fb
commit
2b9ac168ec
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25084
1 changed files with 2 additions and 1 deletions
|
@ -105,7 +105,8 @@ popen(command, type)
|
|||
if (pdes[1] != STDOUT_FILENO) {
|
||||
(void)dup2(pdes[1], STDOUT_FILENO);
|
||||
(void)close(pdes[1]);
|
||||
(void)dup2(STDOUT_FILENO, STDIN_FILENO);
|
||||
if (twoway)
|
||||
(void)dup2(STDOUT_FILENO, STDIN_FILENO);
|
||||
} else if (twoway && (pdes[1] != STDIN_FILENO))
|
||||
(void)dup2(pdes[1], STDIN_FILENO);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue