aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit4a9d6d1fe98439df3f3b80b800d36b8b9cefafcf (patch)
tree9d45a941b692d57dc86276d29a625af4891c5522
parent70f7ef7be385f782e57106df523f1c5e16fbdc47 (diff)
downloadbusybox-w32-4a9d6d1fe98439df3f3b80b800d36b8b9cefafcf.tar.gz
busybox-w32-4a9d6d1fe98439df3f3b80b800d36b8b9cefafcf.tar.bz2
busybox-w32-4a9d6d1fe98439df3f3b80b800d36b8b9cefafcf.zip
remove strange bloat dup2() usage, sync this code with mainstream login-utils, size reduce
-rw-r--r--loginutils/getty.c5
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 /*