File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1696,9 +1696,9 @@ int ios_dup2(int fd1, int fd2)
16961696 case 2 : child_stderr = stream1; return fd2;
16971697 }
16981698 }
1699- if ((fd2 == 0 ) || (fd2 == fileno (thread_stdin))) { child_stdin = fdopen (fd1, " rb" ); }
1700- else if ((fd2 == 1 ) || (fd2 == fileno (thread_stdout))) { child_stdout = fdopen (fd1, " wb" ); }
1701- else if ((fd2 == 2 ) || (fd2 == fileno (thread_stderr))) {
1699+ if ((fd2 == 0 ) || (thread_stdin != NULL && fd2 == fileno (thread_stdin))) { child_stdin = fdopen (fd1, " rb" ); }
1700+ else if ((fd2 == 1 ) || (thread_stdout != NULL && fd2 == fileno (thread_stdout))) { child_stdout = fdopen (fd1, " wb" ); }
1701+ else if ((fd2 == 2 ) || (thread_stderr != NULL && fd2 == fileno (thread_stderr))) {
17021702 if ((child_stdout != NULL ) && (fileno (child_stdout) == fd1)) child_stderr = child_stdout;
17031703 else child_stderr = fdopen (fd1, " wb" ); }
17041704 else if (fd1 != fd2) {
You can’t perform that action at this time.
0 commit comments