Re: incorrect use of pidfile(3)

From: Dag-Erling Smørgrav <des_at_des.no>
Date: Thu, 13 Oct 2011 16:11:40 +0200
Pawel Jakub Dawidek <pjd_at_FreeBSD.org> writes:
> I'm still in opinion that EWOULDBLOCK and EAGAIN (which is the same
> value on FreeBSD) should be converted to EEXIST on pidfile_open()
> return.

The historical (and documented) behavior is to return EAGAIN.

> Also if we now have for loop, why not to put count in there?

Because if we do, there will be a nanosleep after the last
pidfile_read() attempt.  We need to break the loop after pidfile_read()
failed but before nanosleep().

> I'm not very happy about touching pidptr in case of error other than
> EEXIST. This is not documented, but a bit unexpected anyway.

Well, it was your idea, I just moved it to before the loop :)

DES
-- 
Dag-Erling Smørgrav - des_at_des.no
Received on Thu Oct 13 2011 - 12:11:42 UTC

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