Skip to content

Commit

Permalink
windows compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 14, 2024
1 parent 40961e0 commit 7d3cbbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down Expand Up @@ -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 };
Expand Down

0 comments on commit 7d3cbbf

Please sign in to comment.