Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Mar 2013 10:11:07 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        John Baldwin <jhb@freebsd.org>, Pawel Jakub Dawidek <pjd@freebsd.org>
Cc:        freebsd-current Current <freebsd-current@freebsd.org>
Subject:   Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked
Message-ID:  <455D2A2E-97FE-42EF-A371-B7D7A9A0E14C@mac.com>
In-Reply-To: <201303141250.59521.jhb@freebsd.org>
References:  <513F8D20.2050707@erdgeist.org> <201303140942.40945.jhb@freebsd.org> <20130314162958.GD1344@garage.freebsd.pl> <201303141250.59521.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?455D2A2E-97FE-42EF-A371-B7D7A9A0E14C>