aboutsummaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-09-06 04:45:36 -0500
committerRob Landley <rob@landley.net>2013-09-06 04:45:36 -0500
commit46e8e1dcb3f616a675bf33c83531ee05a4dd8374 (patch)
tree0b94094c3dec3bd09d2dcd58d85d69425b03888c /lib/xwrap.c
parentb6dd79b93db4c6ff0ef21d4ca11610e18533173f (diff)
downloadtoybox-46e8e1dcb3f616a675bf33c83531ee05a4dd8374.tar.gz
Fix for xpidfile spotted by Felix Janda.
Diffstat (limited to 'lib/xwrap.c')
-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.
}