+ fprintf(stderr,GT_("fetchmail: removing stale lockfile\n"));
+ if (unlink(lockfile)) {
+ if (errno != ENOENT) {
+ perror(lockfile);
+ /* we complain but we don't exit; it might be
+ * writable for us, but in a directory we cannot
+ * write to. This means we can write the new PID to
+ * the file. Truncate to be safe in case the PID is
+ * recycled by another process later.
+ * \bug we should use fcntl() style locks or
+ * something else instead in a future release. */
+ if (truncate(lockfile, (off_t)0)) {
+ /* but if we cannot truncate the file either,
+ * assume that we cannot write to it later,
+ * complain and quit. */
+ perror(lockfile);
+ exit(PS_EXCLUDE);
+ }
+ }
+ }
+ }
+ } else {
+ pid = 0;
+ if (errno != ENOENT) {
+ fprintf(stderr, GT_("fetchmail: error opening lockfile \"%s\": %s\n"),
+ lockfile, strerror(errno));
+ exit(PS_EXCLUDE);