]> git.meshlink.io Git - meshlink/blobdiff - lib/pidfile.c
Big header file cleanup: everything that has to do with standard system
[meshlink] / lib / pidfile.c
index 54a6b4c16d6ccb7444ff6dc6bb357d90f2abaa96..2dea70b9ceed5f4ac617501fe329ffbff0dea830 100644 (file)
  *     First version (v0.2) released
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <fcntl.h>
+#include "system.h"
 
 /* read_pid
  *
@@ -73,6 +65,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);