Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2011 16:11:40 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        current@freebsd.org
Subject:   Re: incorrect use of pidfile(3)
Message-ID:  <86mxd59e1v.fsf@ds4.des.no>
In-Reply-To: <20111013134841.GF1667@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Thu, 13 Oct 2011 15:48:42 %2B0200")
References:  <86pqi1b1qp.fsf@ds4.des.no> <864nzdaw7b.fsf@ds4.des.no> <20111013134841.GF1667@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
Pawel Jakub Dawidek <pjd@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
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86mxd59e1v.fsf>