summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index d1ed02f..16901bb 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -312,7 +312,8 @@ ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
* Don't actually close the device if it is being used as the
* console.
*/
- if (strcmp(dev_console_filename, tty_devname(tp)) == 0)
+ if (dev_console_filename != NULL &&
+ strcmp(dev_console_filename, tty_devname(tp)) == 0)
return (0);
tty_lock(tp);
OpenPOWER on IntegriCloud