diff options
author | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-12-13 08:44:41 +0000 |
---|---|---|
committer | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-12-13 08:44:41 +0000 |
commit | 2222d8c2df24de613324ab9ac9098fbca206e26b (patch) | |
tree | 9d45a941b692d57dc86276d29a625af4891c5522 | |
parent | 29984542f111692854c0ab2bb7d453b765cfd67a (diff) | |
download | busybox-w32-2222d8c2df24de613324ab9ac9098fbca206e26b.tar.gz busybox-w32-2222d8c2df24de613324ab9ac9098fbca206e26b.tar.bz2 busybox-w32-2222d8c2df24de613324ab9ac9098fbca206e26b.zip |
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
-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) | |||
528 | 528 | ||
529 | /* Open the tty as standard input. */ | 529 | /* Open the tty as standard input. */ |
530 | 530 | ||
531 | close(0); | ||
531 | debug("open(2)\n"); | 532 | debug("open(2)\n"); |
532 | fd = open(tty, O_RDWR | O_NONBLOCK, 0); | 533 | fd = open(tty, O_RDWR | O_NONBLOCK, 0); |
533 | if (dup2(fd, STDIN_FILENO) == -1) | 534 | if (fd != 0) |
534 | error("/dev/%s: cannot open as standard input: %m", tty); | 535 | error("/dev/%s: cannot open as standard input: %m", tty); |
535 | close(fd); | ||
536 | |||
537 | } else { | 536 | } else { |
538 | 537 | ||
539 | /* | 538 | /* |