From: Victor Julien Date: Mon, 17 Jul 2017 14:20:22 +0000 (+0200) Subject: mingw: disable pid checking from pidfile X-Git-Tag: suricata-4.1.0-beta1~397 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=275eb839d1087c6f5cec18d17c6b67f9f529d429;p=thirdparty%2Fsuricata.git mingw: disable pid checking from pidfile kill() call is not supported in MinGW --- diff --git a/src/util-pidfile.c b/src/util-pidfile.c index a68188b7e6..b801e41e46 100644 --- a/src/util-pidfile.c +++ b/src/util-pidfile.c @@ -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. "