Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked

From: Pawel Jakub Dawidek <pjd_at_FreeBSD.org>
Date: Thu, 14 Mar 2013 09:44:20 +0100
On Thu, Mar 14, 2013 at 08:28:25AM +0100, Dirk Engling wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 13.03.13 23:08, Pawel Jakub Dawidek wrote:
> 
> > I think I considered something similar at first, but the change I 
> > proposed was optimal, IMHO at the cost of producing pretty large
> > diff, because of indentation change. But to be sure, can you send a
> > patch of your proposed change?
> 
> http://erdgeist.org/arts/software/Code/pidfile.c.diff

Right. Your patch assumes EWOULDBLOCK is equal to EAGAIN, which is true
on FreeBSD, but is not portable. Also in case pidptr is NULL you compare
errno three times instead of just one (not a big deal of course, just
something that could be done a bit more optimal:)).

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl

Received on Thu Mar 14 2013 - 07:42:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:35 UTC