diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2005-10-30 19:36:47 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2005-10-30 19:36:47 +0000 |
commit | 3f9c96674b47120d42e48b17d8de9939fe70ed88 (patch) | |
tree | 907e5b926b5e618fab7058625fe57e13163dae09 /lock.c | |
parent | 6819e08663b3adf8f5ce4ed7dbc01aaba814e7fd (diff) | |
download | fetchmail-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 { |