aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/xwrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 90c4d86a..fdd2db47 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -463,7 +463,7 @@ void xpidfile(char *name)
spid[xread(fd, spid, sizeof(spid)-1)] = 0;
close(fd);
pid = atoi(spid);
- if (pid < 1 || kill(pid, 0) == ESRCH) unlink(pidfile);
+ if (pid < 1 || (kill(pid, 0) && errno == ESRCH)) unlink(pidfile);
// An else with more sanity checking might be nice here.
}