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 @@ -1694,9 +1694,9 @@ int ios_dup2(int fd1, int fd2)
16941694 case 2 : child_stderr = stream1; return fd2;
16951695 }
16961696 }
1697- if ((fd2 == 0 ) || (fd2 == fileno (thread_stdin))) { child_stdin = fdopen (fd1, " rb" ); }
1698- else if ((fd2 == 1 ) || (fd2 == fileno (thread_stdout))) { child_stdout = fdopen (fd1, " wb" ); }
1699- else if ((fd2 == 2 ) || (fd2 == fileno (thread_stderr))) {
1697+ if ((fd2 == 0 ) || (thread_stdin != NULL && fd2 == fileno (thread_stdin))) { child_stdin = fdopen (fd1, " rb" ); }
1698+ else if ((fd2 == 1 ) || (thread_stdout != NULL && fd2 == fileno (thread_stdout))) { child_stdout = fdopen (fd1, " wb" ); }
1699+ else if ((fd2 == 2 ) || (thread_stderr != NULL && fd2 == fileno (thread_stderr))) {
17001700 if ((child_stdout != NULL ) && (fileno (child_stdout) == fd1)) child_stderr = child_stdout;
17011701 else child_stderr = fdopen (fd1, " wb" ); }
17021702 else if (fd1 != fd2) {
You can’t perform that action at this time.
0 commit comments