]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: keep the current baud before try 9600 on serial lines
authorKarel Zak <kzak@redhat.com>
Fri, 21 Nov 2014 08:03:00 +0000 (09:03 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 21 Nov 2014 08:03:00 +0000 (09:03 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.8
term-utils/agetty.c

index 4ef1e6b8c1ff7c40549834d52dc2081b64b0a22b..12e481f6cf5b172f7693738626ca08e607fff946 100644 (file)
@@ -70,8 +70,10 @@ the list, which is treated as if it were circular.
 Baud rates should be specified in descending order, so that the
 null character (Ctrl\-@) can also be used for baud-rate switching.
 .sp
-This argument is optional and unnecessary for virtual terminals.
-The default for serial terminals is '9600'.
+This argument is optional and unnecessary for \fBvirtual terminals\fP.
+.sp
+The default for \fBserial terminals\fP is keep the current baud rate
+(see \fB\-\-keep-baud\fP) and if unsuccessful then default to '9600'.
 .TP
 term
 The value to be used for the TERM environment variable. This overrides
index 5181de15060a13fa8640bc461f0ddb6489a08878..34ad7f230d07906f735c2c90bab0de3f0393563e 100644 (file)
@@ -387,9 +387,11 @@ int main(int argc, char **argv)
 
        tcsetpgrp(STDIN_FILENO, getpid());
 
-       /* Default serial line speed (may be ignored on --{extract,keep}-baud) */
-       if ((options.flags & F_VCONSOLE) == 0 && options.numspeed == 0)
+       /* Default is to follow the current line speend and then default to 9600 */
+       if ((options.flags & F_VCONSOLE) == 0 && options.numspeed == 0) {
                options.speeds[options.numspeed++] = bcode("9600");
+               options.flags |= F_KEEPSPEED
+       }
 
        /* Initialize the termios settings (raw mode, eight-bit, blocking i/o). */
        debug("calling termio_init\n");