From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2162 invoked from network); 5 May 2008 01:25:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) 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.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 May 2008 01:25:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 64096 invoked from network); 5 May 2008 01:25:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 May 2008 01:25:08 -0000 Received: (qmail 22745 invoked by alias); 5 May 2008 01:25:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24921 Received: (qmail 22733 invoked from network); 5 May 2008 01:25:05 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 5 May 2008 01:25:05 -0000 Received: from dot.blorf.net (dsl-74-220-69-132.cruzio.com [74.220.69.132]) by bifrost.dotsrc.org (Postfix) with ESMTP id 9FBB080ED172 for ; Mon, 5 May 2008 03:25:00 +0200 (CEST) Received: by dot.blorf.net (Postfix, from userid 1000) id 3A04EB9A; Sun, 4 May 2008 18:25:51 -0700 (PDT) Date: Sun, 4 May 2008 18:25:51 -0700 From: Wayne Davison To: zsh-workers@sunsite.dk Subject: Re: [PATCH] history locking with fcntl Message-ID: <20080505012551.GC11804@blorf.net> References: <20080415153120.GE1223@prunille.vinc17.org> <20080417162307.GB22594@blorf.net> <20080418005959.GB1067@prunille.vinc17.org> <20080419023155.GB23964@blorf.net> <20080421131937.GM4304@prunille.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080421131937.GM4304@prunille.vinc17.org> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) X-Virus-Scanned: ClamAV 0.91.2/7028/Mon May 5 02:51:17 2008 on bifrost X-Virus-Status: Clean 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. Since it is done with the write at that point, it should be OK (in my latest version). My code was deficient if it then went on to rewrite the HISTFILE before returning, as it would not lock the file using fcntl() if it thought it was already locked. I've fixed that, and checked in the result. ..wayne..