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

case.
This commit is contained in:
bde 1997-04-22 09:44:06 +00:00
parent ae3a563c6e
commit 5e1197d908

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 {