mirror of
https://github.com/sheumann/hush.git
synced 2024-08-21 11:28:57 +00:00
getty: do not emit bogus error message on EOF
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
fef9ee7072
commit
765b0eed3e
@ -431,6 +431,7 @@ static char *get_logname(char *logname, unsigned size_logname,
|
||||
while (cp->eol == '\0') {
|
||||
|
||||
/* Do not report trivial EINTR/EIO errors. */
|
||||
errno = EINTR; /* make read of 0 bytes be silent too */
|
||||
if (read(STDIN_FILENO, &c, 1) < 1) {
|
||||
if (errno == EINTR || errno == EIO)
|
||||
exit(EXIT_SUCCESS);
|
||||
|
Loading…
Reference in New Issue
Block a user