suspect spl*() code in syscons.c

Luigi Rizzo rizzo at icir.org
Tue Oct 21 15:47:41 PDT 2003


Hi,
both -current and -stable have the following snippet of code in
sys/dev/syscons/syscons.c:scclose():

	{
	    ...
	    int s;

	    if (SC_VTY(dev) != SC_CONSOLECTL) {
		...
		s = spltty();
		...
	    }
	    spltty();
	    (*linesw[tp->t_line].l_close)(tp, flag);
	    ttyclose(tp);
	    spl0();
	    return(0);
	}

Note that the omitted code never does any spl*() call, nor it
uses the saved value anymore. Also, i am a bit suspicious about the
spltty()/spl0() sequence.

Can someone explain if this code is correct ?
(I have Bcc-ed the committers involved in writing this code,
maybe they know the answer).

	cheers
	luigi


More information about the freebsd-hackers mailing list