>Date: Wed, 24 Oct 2001 15:12:52 -0500
>From: Jonathan Lemon <[EMAIL PROTECTED]>

>>     I suspect that this is the problem with the devfs/console code.

>Ugh.  Probably.  The console code tries to remember what flag was
>used from the open, but doesn't use that flag during close.

>Here's an (untested) patch - essentially it forces the FWRITE flag
>always on, to avoid this problem.   Possibly the right thing to do
>is to used a fixed set of flags to open the console, and completely
>ignore the user's specified mode.

OK; that patch seems to have needed a small tweak -- using FWRITE
implies that it's defined, so I need to include sys/fcntl.h; cvs diff
follows my uname ouput:

FreeBSD m147.whistle.com 5.0-CURRENT FreeBSD 5.0-CURRENT #146: Wed Oct 24 14:28:45 PDT 
2001     [EMAIL PROTECTED]:/common/C/obj/usr/src/sys/LAPTOP_30W  i386

Index: sys/kern/tty_cons.c
RCS file: /cvs/freebsd/src/sys/kern/tty_cons.c,v
retrieving revision 1.93
diff -u -r1.93 tty_cons.c
--- sys/kern/tty_cons.c 23 Oct 2001 20:25:50 -0000      1.93
+++ sys/kern/tty_cons.c 24 Oct 2001 21:19:23 -0000
@@ -41,6 +41,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/fcntl.h>
 #include <sys/conf.h>
 #include <sys/cons.h>
 #include <sys/kernel.h>
@@ -365,7 +366,7 @@
        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 +383,7 @@
        STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
                if (cnd->cnd_vp == NULL)
-               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;

Anyway, I'm up & running multi-user on today's -CURRENT.  I wouldn't
take this as proof that the patch is correct, but it's a definite
improvement in behavior....  :-)

David H. Wolfskill                              [EMAIL PROTECTED]
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to