FIxed the cleanup. I forgot to leave stdin alone in the usual (!twoway)

case.
This commit is contained in:
Bruce Evans 1997-04-22 09:44:06 +00:00
parent 9081eec1fb
commit 2b9ac168ec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25084

View file

@ -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 {