From 7d3cbbf3add053ba1281b2ac624cb1d48e3dadf6 Mon Sep 17 00:00:00 2001 From: Folkert van Heusden Date: Mon, 14 Oct 2024 14:52:54 +0200 Subject: [PATCH] windows compile fix --- main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.cpp b/main.cpp index 5569527..dab0e57 100644 --- a/main.cpp +++ b/main.cpp @@ -95,7 +95,9 @@ void help() printf("-D disable digest\n"); printf("-S x enable SNMP agent on port x, usually 161\n"); printf("-P x write PID-file\n"); +#if !defined(__MINGW32__) printf("-f become daemon process\n"); +#endif printf("-h this help\n"); } @@ -216,12 +218,14 @@ int main(int argc, char *argv[]) printf("Go!\n"); +#if !defined(__MINGW32__) if (do_daemon) { if (daemon(-1, -1) == -1) { fprintf(stderr, "Failed to daemonize: %s\n", strerror(errno)); return 1; } } +#endif int cpu_usage { 0 }; int ram_free_kb { 0 };