remove strange bloat dup2() usage, sync this code with mainstream login-utils, size reduce
This commit is contained in:
parent
70f7ef7be3
commit
4a9d6d1fe9
@ -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 {
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user