From 3f9c96674b47120d42e48b17d8de9939fe70ed88 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 30 Oct 2005 19:36:47 +0000 Subject: Only report 'removing stale lockfile' if it was actually removed. svn path=/trunk/; revision=4376 --- lock.c | 10 +++++++--- 1 file 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 { -- cgit v1.2.3