Date: Wed, 13 Mar 2013 23:08:31 +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: <20130313220831.GF1372@garage.freebsd.pl> In-Reply-To: <alpine.BSF.2.00.1303132256540.67262@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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Wed, Mar 13, 2013 at 10:59:17PM +0100, Dirk Engling wrote: > > On Wed, 13 Mar 2013, Pawel Jakub Dawidek wrote: > > > How about this patch? > > > > http://people.freebsd.org/~pjd/patches/pidfile.c.patch > > If you move the lines > > + if (errno == 0 || errno == EAGAIN) > + errno = EEXIST; > > out of the else branch, you can get rid of the if branch, guard the else > branch by a > > + if (pidptr) { > > and let the if (errno == 0 || errno == 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? -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlFA+N8ACgkQForvXbEpPzSwOwCgucrbfgLbYpEndajoK84jzNel TbYAoIlOUughbXL1fwTXkqucJtyv4pNk =Nnvl -----END PGP SIGNATURE-----home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130313220831.GF1372>
