From: Jacek Konieczny Subject: Re: [PATCH] Fix locking in tools/hotplug/Linux/locking.sh Date: Mon, 12 Nov 2012 19:34:57 +0100 Message-ID: <20121112183457.GB2114@lolek.nigdzie> References: <1352469371-15457-1-git-send-email-jajcus@jajcus.net> <1352738557.27833.302.camel@zakaz.uk.xensource.com> <20121112180738.GA26672@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20121112180738.GA26672@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: "xen-devel@lists.xensource.com" , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Mon, Nov 12, 2012 at 07:07:38PM +0100, Olaf Hering wrote: > On Mon, Nov 12, Ian Campbell wrote: > > > On Fri, 2012-11-09 at 13:56 +0000, Jacek Konieczny wrote: > > > The claim_lock() function would fail in the perl code with: > > > > > > Invalid argument at -e line 2. > > > > > > because the Perl snippet opens for reading the file descriptor, which > > > was earlier opened for write (append). > > > > Looks plausible to me. > > > > How does this interact with the > > eval "exec $_lockfd<&-" > > which Olaf added in 26079:b3b03536789a ? I suppose close is close and > > <&- and >&- or even <>&- are equivalent? > > I did not see the perl error, in what environment did you notice this > error? Xen 4.2.0 # uname -rm 3.6.6-aos4 x86_64 # perl --version This is perl, v5.8.8 built for x86_64-pld-linux-thread-multi I find it a bit strange that it seems to work for everybody else that me, but the source of my error seems obvious (opening write-only file descriptor for reading). I guess my perl, for some reason, does something more when using open() on an existing file descriptor. Greets, Jacek