Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/common Fix the OTIOCGETD emulation. Line discipli...



details:   https://anonhg.NetBSD.org/src/rev/bd5177e47329
branches:  trunk
changeset: 937084:bd5177e47329
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Aug 08 19:04:58 2020 +0000

description:
Fix the OTIOCGETD emulation. Line discipline 0 is NTTYDISC.

diffstat:

 sys/compat/common/tty_43.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 37156bfd5e86 -r bd5177e47329 sys/compat/common/tty_43.c
--- a/sys/compat/common/tty_43.c        Sat Aug 08 18:54:04 2020 +0000
+++ b/sys/compat/common/tty_43.c        Sat Aug 08 19:04:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_43.c,v 1.36 2020/05/23 23:42:41 ad Exp $   */
+/*     $NetBSD: tty_43.c,v 1.37 2020/08/08 19:04:58 christos Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.36 2020/05/23 23:42:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.37 2020/08/08 19:04:58 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -250,8 +250,8 @@
 
        case OTIOCGETD:
                mutex_spin_enter(&tty_lock);
-               *(int *)data = (tp->t_linesw == NULL) ?
-                   2 /* XXX old NTTYDISC */ : tp->t_linesw->l_no;
+               *(int *)data = (tp->t_linesw == NULL || tp->t_linesw->l_no == 0)
+                   ? 2 /* XXX old NTTYDISC */ : tp->t_linesw->l_no;
                mutex_spin_exit(&tty_lock);
                break;
 



Home | Main Index | Thread Index | Old Index