Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] history locking with fcntl
- X-seq: zsh-workers 26221
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: [PATCH] history locking with fcntl
- Date: Thu, 1 Jan 2009 05:12:21 +0100
- In-reply-to: <20090101040119.GC2137@xxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080415153120.GE1223@xxxxxxxxxxxxxxxxxxx> <20080417162307.GB22594@xxxxxxxxx> <20080418005959.GB1067@xxxxxxxxxxxxxxxxxxx> <20080419023155.GB23964@xxxxxxxxx> <20080421131937.GM4304@xxxxxxxxxxxxxxxxxxx> <20080505012551.GC11804@xxxxxxxxx> <20090101040119.GC2137@xxxxxxxxxxxxxxxxxxx>
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 <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author