summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-03-10 14:23:15 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-03-10 14:23:15 +0000
commit7c302e129f6318a4eca4823d8d79e1777261ad7c (patch)
tree0dbe0639950fe15a1b7d09708c33332aa4fd7a07
parente391f09457c5ce71df740aac17bedd833e64e74b (diff)
downloadzsh-7c302e129f6318a4eca4823d8d79e1777261ad7c.tar.gz
zsh-7c302e129f6318a4eca4823d8d79e1777261ad7c.zip
print message if we give up trying to crate a lock file with hard links
-rw-r--r--ChangeLog5
-rw-r--r--Src/hist.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f6250b694..20b57a802 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-03-10 Peter Stephenson <pws@csr.com>
+ * 26708: Src/hist.c: print message if we give up trying to
+ create a lock file with hard links.
+
* 26705: Src/subst.c, Test/D07multibyte.ztst: still problems
with multibyte characters with Meta in prompt expansion within
parameter expansion.
@@ -11367,5 +11370,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4607 $
+* $Revision: 1.4608 $
*****************************************************
diff --git a/Src/hist.c b/Src/hist.c
index dbe1d98a4..38ceac30a 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2433,13 +2433,16 @@ lockhistfile(char *fn, int keep_trying)
} else
close(fd);
while (link(tmpfile, lockfile) < 0) {
- if (errno != EEXIST || !keep_trying)
+ if (errno != EEXIST)
+ zerr("failed to create hard link as lock file %s: %e",
+ lockfile, errno);
+ else if (!keep_trying)
;
else if (stat(lockfile, &sb) < 0) {
if (errno == ENOENT)
continue;
- }
- else {
+ zerr("failed to stat lock file %s: %e", lockfile, errno);
+ } else {
if (time(NULL) - sb.st_mtime < 10)
sleep(1);
else