diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-12-13 08:44:41 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-12-13 08:44:41 +0000 |
commit | 4a9d6d1fe98439df3f3b80b800d36b8b9cefafcf (patch) | |
tree | 9d45a941b692d57dc86276d29a625af4891c5522 | |
parent | 70f7ef7be385f782e57106df523f1c5e16fbdc47 (diff) | |
download | busybox-4a9d6d1fe98439df3f3b80b800d36b8b9cefafcf.tar.gz |
remove strange bloat dup2() usage, sync this code with mainstream login-utils, size reduce
-rw-r--r-- | loginutils/getty.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c index e8643ef93..1cfbd6734 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -528,12 +528,11 @@ static void open_tty(char *tty, struct termio *tp, int local) /* Open the tty as standard input. */ + close(0); debug("open(2)\n"); fd = open(tty, O_RDWR | O_NONBLOCK, 0); - if (dup2(fd, STDIN_FILENO) == -1) + if (fd != 0) error("/dev/%s: cannot open as standard input: %m", tty); - close(fd); - } else { /* |