From owner-freebsd-current@FreeBSD.ORG Thu Mar 14 09:33:39 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E61936BA for ; Thu, 14 Mar 2013 09:33:39 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.13.206.130]) by mx1.freebsd.org (Postfix) with ESMTP id 366E3E43 for ; Thu, 14 Mar 2013 09:33:38 +0000 (UTC) Received: (qmail 666 invoked from network); 14 Mar 2013 09:33:36 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with AES256-SHA encrypted SMTP; 14 Mar 2013 09:33:36 -0000 Date: Thu, 14 Mar 2013 10:33:35 +0100 (CET) From: Dirk Engling To: Pawel Jakub Dawidek Subject: Re: pidfile_open incorrectly returns EAGAIN when pidfile is locked In-Reply-To: <20130314084420.GH1372@garage.freebsd.pl> Message-ID: References: <513F8D20.2050707@erdgeist.org> <201303131118.36811.jhb@freebsd.org> <20130313212750.GC1372@garage.freebsd.pl> <20130313220831.GF1372@garage.freebsd.pl> <51417C19.9060002@erdgeist.org> <20130314084420.GH1372@garage.freebsd.pl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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, 14 Mar 2013 09:33:40 -0000 On Thu, 14 Mar 2013, Pawel Jakub Dawidek wrote: > Right. Your patch assumes EWOULDBLOCK is equal to EAGAIN, which is true > on FreeBSD, but is not portable. Also in case pidptr is NULL you compare > errno three times instead of just one (not a big deal of course, just > something that could be done a bit more optimal:)). You're right. OTOH, wouldn't modifying pidfile_read to return EAGAIN and not EWOULDBLOCK totally be worth saving that 2 lines in the patch? ;) erdgeist