Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] history locking with fcntl



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