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

Re: [PATCH] history locking with fcntl



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..



Messages sorted by: Reverse Date, Date, Thread, Author