getty: do not emit bogus error message on EOF
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 22 May 2010 19:17:46 +0000 (21:17 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 22 May 2010 19:17:46 +0000 (21:17 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/getty.c

index d032357e2401a931c9061dcdd3bbba3e9e879f4a..7fb861f9d50b378e105eceb2713f5f3b3e359d46 100644 (file)
@@ -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);