Don't bother closing fds 0-2 before dup2ing over them; there's no
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 21 Oct 2002 23:00:18 +0000 (23:00 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 21 Oct 2002 23:00:18 +0000 (23:00 +0000)
need, and it means we always have a valid open stderr.

git-svn-id: svn://svn.tartarus.org/sgt/putty@2109 cda61777-01e9-0310-a592-d414129be87e

unix/pty.c

index 027e139..43923e9 100644 (file)
@@ -432,9 +432,6 @@ static char *pty_init(char *host, int port, char **realhost, int nodelay)
        }
 
        close(pty_master_fd);
-       close(0);
-       close(1);
-       close(2);
        fcntl(slavefd, F_SETFD, 0);    /* don't close on exec */
        dup2(slavefd, 0);
        dup2(slavefd, 1);