From 068da3804465f7fe3ae3deb08fa017520b49144b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 21 Oct 2002 23:00:18 +0000 Subject: [PATCH] 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] --- unix/pty.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/unix/pty.c b/unix/pty.c index 027e1391..43923e93 100644 --- a/unix/pty.c +++ b/unix/pty.c @@ -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);