changeset 1053:501fd74c028e

Fix for xpidfile spotted by Felix Janda.
author Rob Landley <rob@landley.net>
date Fri, 06 Sep 2013 04:45:36 -0500
parents dc9e297ae13b
children 0d8a664f9941
files lib/xwrap.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/xwrap.c	Fri Sep 06 01:55:53 2013 -0500
+++ b/lib/xwrap.c	Fri Sep 06 04:45:36 2013 -0500
@@ -463,7 +463,7 @@
     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.
   }