From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12580 invoked from network); 1 Jan 2009 04:12:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Jan 2009 04:12:56 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 8556 invoked from network); 1 Jan 2009 04:12:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Jan 2009 04:12:52 -0000 Received: (qmail 6465 invoked by alias); 1 Jan 2009 04:12:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26221 Received: (qmail 6455 invoked from network); 1 Jan 2009 04:12:46 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 1 Jan 2009 04:12:46 -0000 Received: from prunille.vinc17.org (vinc17.pck.nerim.net [213.41.242.187]) by bifrost.dotsrc.org (Postfix) with ESMTP id 89BB680308BE for ; Thu, 1 Jan 2009 05:12:30 +0100 (CET) Received: by prunille.vinc17.org (Postfix, from userid 501) id 462112F83EE4; Thu, 1 Jan 2009 05:12:21 +0100 (CET) Date: Thu, 1 Jan 2009 05:12:21 +0100 From: Vincent Lefevre To: zsh-workers@sunsite.dk Subject: Re: [PATCH] history locking with fcntl Message-ID: <20090101041221.GB17090@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk References: <20080415153120.GE1223@prunille.vinc17.org> <20080417162307.GB22594@blorf.net> <20080418005959.GB1067@prunille.vinc17.org> <20080419023155.GB23964@blorf.net> <20080421131937.GM4304@prunille.vinc17.org> <20080505012551.GC11804@blorf.net> <20090101040119.GC2137@prunille.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090101040119.GC2137@prunille.vinc17.org> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.18-vl-r26315 (2008-12-20) X-Virus-Scanned: ClamAV 0.92.1/8822/Thu Jan 1 03:24:59 2009 on bifrost X-Virus-Status: Clean On 2009-01-01 05:01:19 +0100, Vincent Lefevre wrote: > On 2008-05-04 18:25:51 -0700, Wayne Davison wrote: > > On Mon, Apr 21, 2008 at 03:19:37PM +0200, Vincent Lefevre wrote: > > > Note that since out has been closed, tmpfile is no longer locked. > > > The target file isn't locked either. > > > > The target file was locked prior to the rename (since that's the only > > file my code is locking -- the HISTFILE itself). So, the rename does > > essentially unlock the HISTFILE as far as fcntl() is concerned. > > I've looked again at the current zsh code (which corresponds to your > patch). This is incorrect. Oops, forget my mail. The rename is done only when there's a tmp file, which was the case I excluded. So, the code is OK (I've also re-read it, and there don't seem to be other closes() calls that could remove the lock). Perhaps it lacks a bit documentation, in case the code will have to be modified in the future. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)