From 46e8e1dcb3f616a675bf33c83531ee05a4dd8374 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 6 Sep 2013 04:45:36 -0500 Subject: Fix for xpidfile spotted by Felix Janda. --- lib/xwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. } -- cgit v1.2.3