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

[4.2.0] Src/hist.c:lockhistfile() endless loop



[ Please Cc: me since I'm not subscribed.  Thanks. ]

Hello,

  2141              while (link(tmpfile, lockfile) < 0) {
  2142                  if (stat(lockfile, &sb) < 0) {
  2143                      if (errno == ENOENT)
  2144                          continue;

This looks like an endless loop if
 1) link() fails, and
 2) stat() returns -ENOENT.

It was the case for me with $HOME being on OpenAFS and an expired
ticket (link() returned -EACCES).  What guarantees do we have here
to say that link() will eventually succeed?

Peter

-- 
    .+'''+.         .+'''+.         .+'''+.         .+'''+.         .+''
 Kelemen Péter     /       \       /       \     Peter.Kelemen@xxxxxxx
.+'         `+...+'         `+...+'         `+...+'         `+...+'



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