Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Mar 2013 09:44:20 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Dirk Engling <erdgeist@erdgeist.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked
Message-ID:  <20130314084420.GH1372@garage.freebsd.pl>
In-Reply-To: <51417C19.9060002@erdgeist.org>
References:  <513F8D20.2050707@erdgeist.org> <201303131118.36811.jhb@freebsd.org> <20130313212750.GC1372@garage.freebsd.pl> <alpine.BSF.2.00.1303132256540.67262@erdgeist.org> <20130313220831.GF1372@garage.freebsd.pl> <51417C19.9060002@erdgeist.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--7J16OGEJ/mt06A90
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 14, 2013 at 08:28:25AM +0100, Dirk Engling wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>=20
> On 13.03.13 23:08, Pawel Jakub Dawidek wrote:
>=20
> > I think I considered something similar at first, but the change I=20
> > 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?
>=20
> 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:)).

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

--7J16OGEJ/mt06A90
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlFBjeQACgkQForvXbEpPzTiUgCffVExSr5zUMsgST7+nXsv6Qzv
6agAmgNFGJPKCnZxbwEEdi3S8z3SUhho
=5Sc5
-----END PGP SIGNATURE-----

--7J16OGEJ/mt06A90--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130314084420.GH1372>