From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 21 15:47:41 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1601B16A4B3; Tue, 21 Oct 2003 15:47:41 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF8A343FBF; Tue, 21 Oct 2003 15:47:39 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.3) with ESMTP id h9LMldsd009441; Tue, 21 Oct 2003 15:47:39 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id h9LMldnE009440; Tue, 21 Oct 2003 15:47:39 -0700 (PDT) (envelope-from rizzo) Date: Tue, 21 Oct 2003 15:47:38 -0700 From: Luigi Rizzo To: hackers@freebsd.org Message-ID: <20031021154738.A9175@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Subject: suspect spl*() code in syscons.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2003 22:47:41 -0000 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