1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-05 18:05:16 +00:00

Don't let /dev/console be revoked if the TTY below is being closed.

During startup some of the syscons TTY's are used to set attributes like
the screensaver and mouse options. These actions cause /dev/console to
be rendered unusable.

Fix the issue by leaving the TTY opened when it is used as the console
device.

Reported by:	imp
This commit is contained in:
Ed Schouten 2009-01-02 23:32:43 +00:00
parent a42ea597ff
commit 916501c81c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186706

View File

@ -308,6 +308,13 @@ ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
{
struct tty *tp = dev->si_drv1;
/*
* Don't actually close the device if it is being used as the
* console.
*/
if (strcmp(dev_console_filename, tty_devname(tp)) == 0)
return (0);
tty_lock(tp);
/*