Set errno to 0 before trying to kill the other process.
[tinc] / lib / pidfile.c
index 54a6b4c..a954d18 100644 (file)
@@ -73,6 +73,7 @@ int check_pid (char *pidfile)
    * be found -- GW
    */
   /* But... errno is usually changed only on error.. */
+  errno = 0;
   if (kill(pid, 0) && errno == ESRCH)
          return(0);