From owner-freebsd-current@FreeBSD.ORG Thu Oct 13 14:11:42 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333F1106564A; Thu, 13 Oct 2011 14:11:42 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id EAFA38FC08; Thu, 13 Oct 2011 14:11:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0B60F1FFC34; Thu, 13 Oct 2011 14:11:41 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id E584CB93C; Thu, 13 Oct 2011 16:11:40 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek References: <86pqi1b1qp.fsf@ds4.des.no> <864nzdaw7b.fsf@ds4.des.no> <20111013134841.GF1667@garage.freebsd.pl> Date: Thu, 13 Oct 2011 16:11:40 +0200 In-Reply-To: <20111013134841.GF1667@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Thu, 13 Oct 2011 15:48:42 +0200") Message-ID: <86mxd59e1v.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: current@freebsd.org Subject: Re: incorrect use of pidfile(3) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2011 14:11:42 -0000 Pawel Jakub Dawidek 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