Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked

From: Dirk Engling <erdgeist_at_erdgeist.org>
Date: Wed, 13 Mar 2013 22:59:17 +0100 (CET)
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

Regards,

   erdgeist
Received on Wed Mar 13 2013 - 20:59:27 UTC

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