diff options
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r-- | term-utils/agetty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c index a70683617..5163550fb 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -975,12 +975,12 @@ static void open_tty(char *tty, struct termios *tp, struct options *op) log_err(_("/dev/%s: cannot open as standard input: %m"), tty); /* Sanity checks... */ - if (!isatty(fd)) - log_err(_("/dev/%s: not a character device"), tty); if (fstat(fd, &st) < 0) log_err("%s: %m", buf); if ((st.st_mode & S_IFMT) != S_IFCHR) log_err(_("/dev/%s: not a character device"), tty); + if (!isatty(fd)) + log_err(_("/dev/%s: not a tty"), tty); if (((tid = tcgetsid(fd)) < 0) || (pid != tid)) { if (ioctl(fd, TIOCSCTTY, 1) == -1) |