From owner-freebsd-net@FreeBSD.ORG Sat Feb 19 20:31:07 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02019106564A for ; Sat, 19 Feb 2011 20:31:07 +0000 (UTC) (envelope-from la5lbtyi@aon.at) Received: from email.aon.at (smtpout05.highway.telekom.at [195.3.96.77]) by mx1.freebsd.org (Postfix) with ESMTP id 8ADF18FC08 for ; Sat, 19 Feb 2011 20:31:06 +0000 (UTC) Received: (qmail 25464 invoked from network); 19 Feb 2011 20:31:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on WARSBL604 X-Spam-Level: Received: from 178-191-94-218.adsl.highway.telekom.at (HELO gandalf.xyzzy) ([178.191.94.218]) (envelope-sender ) by smarthub98.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 19 Feb 2011 20:31:04 -0000 Received: from atpcdvvc.xyzzy (atpcdvvc.xyzzy [IPv6:fec0:0:0:4d42::84]) by gandalf.xyzzy (8.14.4/8.14.4) with ESMTP id p1JKV3uM043568 for ; Sat, 19 Feb 2011 21:31:04 +0100 (CET) (envelope-from la5lbtyi@aon.at) Message-ID: <4D602887.8010204@aon.at> Date: Sat, 19 Feb 2011 21:31:03 +0100 From: Martin Birgmeier User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.16) Gecko/20101219 Thunderbird/3.0.11 MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Locking in ng_tty.c X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 20:31:07 -0000 In ng_tty.c, function ngt_newhook(), there is the following code: if (sc->hook) return (EISCONN); NGTLOCK(sc); sc->hook = hook; NGTUNLOCK(sc); I do not think this is proper - should not the test be within the lock? Regards, Martin -- Martin Birgmeier Vienna Austria