From 429ba514ab33ac40721542d6a6af5fa6b1dba50d Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Mon, 3 Apr 2023 18:12:33 +0100 Subject: [PATCH] Disabled PID logic on Windows platforms as we have no easy way to check that process is alive --- src/fastnetmon.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/fastnetmon.cpp b/src/fastnetmon.cpp index e7b9229..01169dc 100644 --- a/src/fastnetmon.cpp +++ b/src/fastnetmon.cpp @@ -1693,6 +1693,14 @@ int main(int argc, char** argv) { exit(0); } + // On Linux and FreeBSD platforms we use kill to check that process with specific PID is alive + // Unfortunately, it's way more tricky to implement such approach on Windows and we decided just to disable this logic +#ifdef _WIN32 + if (do_pid_checks) { + logger << log4cpp::Priority::INFO << "PID logic is not available on Windows"; + exit(1); + } +#else if (do_pid_checks && file_exists(fastnetmon_platform_configuration.pid_path)) { pid_t pid_from_file = 0; @@ -1729,6 +1737,7 @@ int main(int argc, char** argv) { exit(EXIT_FAILURE); } } +#endif lookup_tree_ipv4 = New_Patricia(32); whitelist_tree_ipv4 = New_Patricia(32);