diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-10-25 00:14:16 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-10-25 00:14:16 +0000 |
commit | 5a9e0848db34a5ed03ef25c96a45f2759fd0e14c (patch) | |
tree | 1dc8866f979f644508799bc479e1b2fed04e1977 /sys | |
parent | 3c003a665b6d719bb1288ed367c9b8b5ac0b19f7 (diff) | |
download | FreeBSD-src-5a9e0848db34a5ed03ef25c96a45f2759fd0e14c.zip FreeBSD-src-5a9e0848db34a5ed03ef25c96a45f2759fd0e14c.tar.gz |
Force FWRITE on when opening the console, so that the flags passed to
vn_close match those from vn_open. This fixes the panic some people
were seeing about "vrele: missed vn_close".
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/tty_cons.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 381e6552..441346c 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -43,6 +43,7 @@ #include <sys/systm.h> #include <sys/conf.h> #include <sys/cons.h> +#include <sys/fcntl.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/namei.h> @@ -112,6 +113,8 @@ static int openflag; /* how /dev/console was opened */ static int cn_is_open; static dev_t cn_devfsdev; /* represents the device private info */ +void cndebug(char *); + CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL, NULL, NULL); SET_DECLARE(cons_set, struct consdev); @@ -365,7 +368,7 @@ cnopen(dev_t dev, int flag, int mode, struct thread *td) { struct cn_device *cnd; - openflag = flag; + openflag = flag | FWRITE; /* XXX */ cn_is_open = 1; /* console is logically open */ if (cn_mute) return (0); @@ -382,7 +385,7 @@ cnclose(dev_t dev, int flag, int mode, struct thread *td) STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) { if (cnd->cnd_vp == NULL) continue; - vn_close(cnd->cnd_vp, mode, td->td_proc->p_ucred, td); + vn_close(cnd->cnd_vp, openflag, td->td_proc->p_ucred, td); cnd->cnd_vp = NULL; } cn_is_open = 0; |