Module Name: src
Committed By: christos
Date: Sat Aug 8 19:04:58 UTC 2020
Modified Files:
src/sys/compat/common: tty_43.c
Log Message:
Fix the OTIOCGETD emulation. Line discipline 0 is NTTYDISC.
To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/common/tty_43.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/common/tty_43.c
diff -u src/sys/compat/common/tty_43.c:1.36 src/sys/compat/common/tty_43.c:1.37
--- src/sys/compat/common/tty_43.c:1.36 Sat May 23 19:42:41 2020
+++ src/sys/compat/common/tty_43.c Sat Aug 8 15:04:58 2020
@@ -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 @@ compat_43_ttioctl(struct tty *tp, u_long
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;