Fix auth prompt if stdin is unconnected.
The subprocess code calls pipe(), dups the pipe fd to 0 and then closes the pipe. However, if fd 0 is unconnected, pipe() may generate fd 0 and wreak havoc. The updated code handles this case: - If the write end is already 0, no dup2 and close needed for it. - If the read end is 0, the dup2 of the write end onto 0 already closed it.
parent
1090b9fe
Please register or sign in to comment