]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: Fix IUTF8 flag
authorWerner Fink <werner@suse.de>
Tue, 2 Aug 2011 12:20:31 +0000 (14:20 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Aug 2011 12:20:31 +0000 (14:20 +0200)
Preserve IUTF8 as set up by the kernel, which knows which consoles are
in utf8 mode.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Werner Fink <werner@suse.de>
term-utils/agetty.c

index 6120a26b6e73cdc5a6b78081358152658346113a..203668eadfd03ea519734c0a9ecc6344877825bc 100644 (file)
@@ -977,7 +977,13 @@ static void termio_init(struct options *op, struct termios *tp)
         /* Flush input and output queues, important for modems! */
        tcflush(STDIN_FILENO, TCIOFLUSH);
 
-       tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
+#ifdef IUTF8
+       tp->c_iflag = tp->c_iflag & IUTF8;
+       op->flags |= F_UTF8;
+#else
+       tp->c_iflag = 0;
+#endif
+       tp->c_lflag = tp->c_oflag = 0;
 
        if ((op->flags & F_KEEPCFLAGS) == 0)
                tp->c_cflag = CS8 | HUPCL | CREAD | (tp->c_cflag & CLOCAL);