From owner-freebsd-current@FreeBSD.ORG Wed Mar 13 22:06:58 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 5724425E; Wed, 13 Mar 2013 22:06:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA45F3; Wed, 13 Mar 2013 22:06:57 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 748E66CD; Wed, 13 Mar 2013 23:03:44 +0100 (CET) Date: Wed, 13 Mar 2013 23:08:31 +0100 From: Pawel Jakub Dawidek To: Dirk Engling Subject: Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked Message-ID: <20130313220831.GF1372@garage.freebsd.pl> References: <513F8D20.2050707@erdgeist.org> <201303131118.36811.jhb@freebsd.org> <20130313212750.GC1372@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5CUMAwwhRxlRszMD" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org 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: Wed, 13 Mar 2013 22:06:58 -0000 --5CUMAwwhRxlRszMD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 13, 2013 at 10:59:17PM +0100, Dirk Engling wrote: >=20 > On Wed, 13 Mar 2013, Pawel Jakub Dawidek wrote: >=20 > > How about this patch? > > > > http://people.freebsd.org/~pjd/patches/pidfile.c.patch >=20 > If you move the lines >=20 > + if (errno =3D=3D 0 || errno =3D=3D EAGAIN) > + errno =3D EEXIST; >=20 > out of the else branch, you can get rid of the if branch, guard the else= =20 > branch by a >=20 > + if (pidptr) { >=20 > and let the if (errno =3D=3D 0 || errno =3D=3D EAGAIN) fix the errno 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? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --5CUMAwwhRxlRszMD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlFA+N8ACgkQForvXbEpPzSwOwCgucrbfgLbYpEndajoK84jzNel TbYAoIlOUughbXL1fwTXkqucJtyv4pNk =Nnvl -----END PGP SIGNATURE----- --5CUMAwwhRxlRszMD--