aboutsummaryrefslogtreecommitdiffstats
path: root/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lock.c')
-rw-r--r--lock.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lock.c b/lock.c
index 8a47703a..5d41c587 100644
--- a/lock.c
+++ b/lock.c
@@ -80,10 +80,14 @@ int lock_state(void)
}
if (args == 0 || kill(pid, 0) == -1) {
- fprintf(stderr,GT_("fetchmail: removing stale lockfile\n"));
pid = 0;
- if (unlink(lockfile))
- perror(lockfile);
+ if (unlink(lockfile)) {
+ if (errno != ENOENT) {
+ perror(lockfile);
+ }
+ } else {
+ fprintf(stderr,GT_("fetchmail: removing stale lockfile\n"));
+ }
}
fclose(lockfp); /* not checking should be safe, file mode was "r" */
} else {