Don't bother closing fds 0-2 before dup2ing over them; there's no

need, and it means we always have a valid open stderr.

[originally from svn r2109]
This commit is contained in:
Simon Tatham 2002-10-21 23:00:18 +00:00
Родитель a14e970585
Коммит 068da38044
1 изменённых файлов: 0 добавлений и 3 удалений

Просмотреть файл

@ -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);