svn commit: r285217 - head/usr.sbin/bhyve

John-Mark Gurney jmg at funkthat.com
Tue Jul 7 18:06:30 UTC 2015


Bruce Evans wrote this message on Tue, Jul 07, 2015 at 16:11 +1000:
> - tty_init_console() doesn't set CLOCAL in the lock state device.  So
>    without fixation, bugs like the one in reset(1) break serial consoles.

Here's a patch to fix that:
Index: tty.c
===================================================================
--- tty.c       (revision 284880)
+++ tty.c       (working copy)
@@ -858,6 +858,8 @@ tty_init_console(struct tty *tp, speed_t s)
 {
        struct termios *ti = &tp->t_termios_init_in;
        struct termios *to = &tp->t_termios_init_out;
+       struct termios *lti = &tp->t_termios_lock_in;
+       struct termios *lto = &tp->t_termios_lock_out;
 
        if (s != 0) {
                ti->c_ispeed = ti->c_ospeed = s;
@@ -866,6 +868,8 @@ tty_init_console(struct tty *tp, speed_t s)
 
        ti->c_cflag |= CLOCAL;
        to->c_cflag |= CLOCAL;
+       lti->c_cflag |= CLOCAL;
+       lto->c_cflag |= CLOCAL;
 }
 
 /*

I've tested that this fixes the issue (on a machine that doesn't have
the bhyve fix yet)...

To me this seems a very good way to start it, as it still allows the
sysadmin to change the lock device on the console after boot if they
so choose...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the svn-src-head mailing list