From 7c302e129f6318a4eca4823d8d79e1777261ad7c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 10 Mar 2009 14:23:15 +0000 Subject: print message if we give up trying to crate a lock file with hard links --- Src/hist.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Src/hist.c') 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 -- cgit 1.4.1