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

Re: Unable to read history on latest Cygwin



On Mon, Dec 14, 2009 at 6:19 AM, Thorsten Kampe
<thorsten@xxxxxxxxxxxxxxxx>wrote:

> The result of that is that I'm not able to run zsh "portable" from a
> FAT32 USB thumb drive: "zsh: failed to create hard link as lock file
> /home/thorsten/.zhistory.LOCK: operation not permitted".
>

One simple possibility is to change the two #ifdef HAVE_LINK lines in hist.c
to this:

#if defined HAVE_LINK && !defined __CYGWIN__

That should make it use the open with O_EXCL, which is hopefully atomic.

As for Peter's idea of using a symlink, do you know if the cygwin folks
mention if their emulation of a symlink is an atomic operation?  We could
completely get rid of the temp file (used in the hard-link code) and just
create a symlink named for the lock file, pointing at (essentially)
$PID/$HOST (since it doesn't matter if the link is valid, just that it
exists).  According to various web docs, symlinks are atomic on NFS, so that
might be a good thing to use in general (replacing the use of link()).

..wayne..


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