From owner-freebsd-current@FreeBSD.ORG Thu Mar 14 17:11:39 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08378A6A; Thu, 14 Mar 2013 17:11:39 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from nk11p00mm-asmtp009.mac.com (nk11p00mm-asmtp009.mac.com [17.158.161.8]) by mx1.freebsd.org (Postfix) with ESMTP id C07A0D64; Thu, 14 Mar 2013 17:11:38 +0000 (UTC) Received: from cswiger1.apple.com ([17.209.4.71]) by nk11p00mm-asmtp009.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MJN00BN3UEJUA00@nk11p00mm-asmtp009.mac.com>; Thu, 14 Mar 2013 17:11:08 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8626,1.0.431,0.0.0000 definitions=2013-03-14_06:2013-03-14,2013-03-14,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1302030000 definitions=main-1303140104 Subject: Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked MIME-version: 1.0 (Apple Message framework v1085) Content-type: text/plain; charset=us-ascii From: Chuck Swiger In-reply-to: <201303141250.59521.jhb@freebsd.org> Date: Thu, 14 Mar 2013 10:11:07 -0700 Content-transfer-encoding: 7bit Message-id: <455D2A2E-97FE-42EF-A371-B7D7A9A0E14C@mac.com> References: <513F8D20.2050707@erdgeist.org> <201303140942.40945.jhb@freebsd.org> <20130314162958.GD1344@garage.freebsd.pl> <201303141250.59521.jhb@freebsd.org> To: John Baldwin , Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1085) Cc: freebsd-current Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Mar 2013 17:11:39 -0000 Hi-- On Mar 14, 2013, at 9:50 AM, John Baldwin wrote: > On Thursday, March 14, 2013 12:29:58 pm Pawel Jakub Dawidek wrote: [ ... ] >> Heh, I did consider that as well, but here you check errno twice, >> instead of once. Guys, is there anything wrong with the patch I >> proposed? > > I'm sure the compiler can work that out just fine and it should do whatever > is most readable to the programmer. I don't care either way. Strong +1. Having the code be correct and readable is much more important then trying to hand-optimize a single-digit # of integer compares in startup code that usually runs ~once per process. (Worrying about and minimizing file access to the pidfile would be a different matter, since the compiler can't optimize around that...) Regards, -- -Chuck