Commit 3f9c9667 authored by Matthias Andree's avatar Matthias Andree

Only report 'removing stale lockfile' if it was actually removed.

svn path=/trunk/; revision=4376
parent 6819e086
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment