Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common When c_ospeed in termio is null, Net...



details:   https://anonhg.NetBSD.org/src/rev/188f3438e594
branches:  trunk
changeset: 510218:188f3438e594
user:      manu <manu%NetBSD.org@localhost>
date:      Tue May 22 21:05:49 2001 +0000

description:
When c_ospeed in termio is null, NetBSD hangup the terminal. Since Linux
does not do this, we fake null c_ospeed values by -1 in the kernel, so
that NetBSD does not hangup.

diffstat:

 sys/compat/linux/common/linux_termios.c |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r 5ff361f27aa5 -r 188f3438e594 sys/compat/linux/common/linux_termios.c
--- a/sys/compat/linux/common/linux_termios.c   Tue May 22 20:59:25 2001 +0000
+++ b/sys/compat/linux/common/linux_termios.c   Tue May 22 21:05:49 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_termios.c,v 1.11 2001/02/21 21:39:57 jdolecek Exp $      */
+/*     $NetBSD: linux_termios.c,v 1.12 2001/05/22 21:05:49 manu Exp $  */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -325,6 +325,13 @@
        if (index & LINUX_CBAUDEX)
                index = (index & ~LINUX_CBAUDEX) + LINUX_NSPEEDS - 1;
        bts->c_ispeed = bts->c_ospeed = linux_speeds[index];
+       /*
+        * A null c_ospeed causes NetBSD to hangup the terminal. 
+        * Linux does not do this, and it sets c_ospeed to zero
+        * sometimes. If it is null, we store -1 in the kernel
+        */ 
+       if (bts->c_ospeed == 0)
+               bts->c_ospeed = -1;
 
        bts->c_cc[VINTR] = lts->c_cc[LINUX_VINTR];
        bts->c_cc[VQUIT] = lts->c_cc[LINUX_VQUIT];
@@ -419,6 +426,13 @@
                        break;
                }
        }
+       /*
+        * A null c_ospeed causes NetBSD to hangup the terminal. 
+        * Linux does not do this, and it sets c_ospeed to zero
+        * sometimes. If it is null, we store -1 in the kernel
+        */ 
+       if (bts->c_ospeed == -1)
+               bts->c_ospeed = 0;
        lts->c_cflag |= mask;
 
        lts->c_cc[LINUX_VINTR] = bts->c_cc[VINTR];



Home | Main Index | Thread Index | Old Index