summaryrefslogtreecommitdiff
path: root/Src/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c9
1 files changed, 6 insertions, 3 deletions
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