pidfile_open incorrectly returns EAGAIN when pidfile is locked

Dirk Engling erdgeist at erdgeist.org
Wed Mar 13 21:59:27 UTC 2013


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


More information about the freebsd-current mailing list