]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mingw: disable pid checking from pidfile
authorVictor Julien <victor@inliniac.net>
Mon, 17 Jul 2017 14:20:22 +0000 (16:20 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 20 Dec 2017 15:23:31 +0000 (16:23 +0100)
kill() call is not supported in MinGW

src/util-pidfile.c

index a68188b7e6167d89a35f50a8683f68b27151cc00..b801e41e468e352157cff574ebd78d1d3ef56594 100644 (file)
@@ -106,7 +106,6 @@ int SCPidfileTestRunning(const char *pid_filename)
 {
     if (access(pid_filename, F_OK) == 0) {
         /* Check if the existing process is still alive. */
-        pid_t pidv;
         FILE *pf;
 
         pf = fopen(pid_filename, "r");
@@ -117,11 +116,15 @@ int SCPidfileTestRunning(const char *pid_filename)
             return -1;
         }
 
+#ifndef OS_WIN32
+        pid_t pidv;
         if (fscanf(pf, "%d", &pidv) == 1 && kill(pidv, 0) == 0) {
             SCLogError(SC_ERR_INITIALIZATION,
                     "pid file '%s' exists and Suricata appears to be running. "
                     "Aborting!", pid_filename);
-        } else {
+        } else
+#endif
+        {
             SCLogError(SC_ERR_INITIALIZATION,
                     "pid file '%s' exists but appears stale. "
                     "Make sure Suricata is not running and then remove %s. "