From 275eb839d1087c6f5cec18d17c6b67f9f529d429 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 17 Jul 2017 16:20:22 +0200 Subject: [PATCH] mingw: disable pid checking from pidfile kill() call is not supported in MinGW --- src/util-pidfile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. "