summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorKarel Zak2014-05-13 12:28:48 +0200
committerKarel Zak2014-05-13 12:28:48 +0200
commitc6b351394223c2f8fd30ead67b167d76f9a956a4 (patch)
treedb89244702a5e33760edd8ede86c5311da83212c /term-utils/agetty.c
parentcfdisk: update man page COLORS section (diff)
downloadkernel-qcow2-util-linux-c6b351394223c2f8fd30ead67b167d76f9a956a4.tar.gz
kernel-qcow2-util-linux-c6b351394223c2f8fd30ead67b167d76f9a956a4.tar.xz
kernel-qcow2-util-linux-c6b351394223c2f8fd30ead67b167d76f9a956a4.zip
agetty: fix odd check for chardev/tty
References: https://bugzilla.redhat.com/show_bug.cgi?id=1069902 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c4
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)