diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2016-03-15 19:16:14 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2016-03-15 19:19:14 +0000 |
commit | c99b02de6c9788335fd4ea1da063248f0265ad91 (patch) | |
tree | b905a6b350e455cc996f068dd17e204d1e91e391 /src | |
parent | 43ff44e918b762b98b495a91fcd4f0d2f8049bce (diff) |
Utilites: fix exim_lock
Unaccountable fails to lock, seen in testsuite
Fix appeared when tidying a Coverity "unchecked returncode" fault
Diffstat (limited to 'src')
-rw-r--r-- | src/src/exim_lock.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/src/exim_lock.c b/src/src/exim_lock.c index 37d974477..4b2209b05 100644 --- a/src/src/exim_lock.c +++ b/src/src/exim_lock.c @@ -216,7 +216,7 @@ for (i = 1; i < argc; i++) else usage(); } -if (quiet) verbose = 0; +if (quiet) verbose = FALSE; /* Can't use flock() if the OS doesn't provide it */ @@ -322,7 +322,7 @@ for (j = 0; j < lock_retries; j++) if (use_lockfile) { - int rc; + int rc, rc2; if (verbose) printf("exim_lock: creating lock file\n"); hd = open(hitchname, O_WRONLY | O_CREAT | O_EXCL, 0440); if (hd < 0) @@ -334,11 +334,12 @@ for (j = 0; j < lock_retries; j++) /* Apply hitching post algorithm. */ - if ((rc = link(hitchname, lockname)) != 0) fstat(hd, &statbuf); + if ((rc = link(hitchname, lockname)) != 0) + rc2 = fstat(hd, &statbuf); (void)close(hd); unlink(hitchname); - if (rc != 0 && statbuf.st_nlink != 2) + if (rc != 0 && (rc2 != 0 || statbuf.st_nlink != 2)) { printf("exim_lock: failed to link hitching post to lock file\n"); hd = -1; |