From 2222d8c2df24de613324ab9ac9098fbca206e26b Mon Sep 17 00:00:00 2001 From: vodz Date: Tue, 13 Dec 2005 08:44:41 +0000 Subject: remove strange bloat dup2() usage, sync this code with mainstream login-utils, size reduce git-svn-id: svn://busybox.net/trunk/busybox@12857 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- loginutils/getty.c | 5 ++--- 1 file 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 { /* -- cgit v1.2.3-55-g6feb