aboutsummaryrefslogtreecommitdiffstats
path: root/lock.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2005-10-30 19:36:47 +0000
committerMatthias Andree <matthias.andree@gmx.de>2005-10-30 19:36:47 +0000
commit3f9c96674b47120d42e48b17d8de9939fe70ed88 (patch)
tree907e5b926b5e618fab7058625fe57e13163dae09 /lock.c
parent6819e08663b3adf8f5ce4ed7dbc01aaba814e7fd (diff)
downloadfetchmail-3f9c96674b47120d42e48b17d8de9939fe70ed88.tar.gz
fetchmail-3f9c96674b47120d42e48b17d8de9939fe70ed88.tar.bz2
fetchmail-3f9c96674b47120d42e48b17d8de9939fe70ed88.zip
Only report 'removing stale lockfile' if it was actually removed.
svn path=/trunk/; revision=4376
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 {