X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=4c33dc070e1bd330802704cee9f0059e1460d2f0;hb=c8402791b82947c49ba1d04f855dab04191607ca;hp=8a4c1f394830d8e5a8c6e7a407c87cf05bd052a1;hpb=d2949381713c35210a43391524494c639f6f1d48;p=tinc diff --git a/src/tincd.c b/src/tincd.c index 8a4c1f39..4c33dc07 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -57,6 +57,7 @@ #include "random.h" #include "sandbox.h" #include "watchdog.h" +#include "fs.h" /* If nonzero, display usage information and exit. */ static bool show_help = false; @@ -415,7 +416,9 @@ static bool drop_privs(void) { return false; } -#endif +#endif // HAVE_WINDOWS + + makedirs(DIR_CACHE | DIR_HOSTS | DIR_INVITATIONS); return sandbox_enter(); } @@ -500,6 +503,9 @@ int main(int argc, char **argv) { #endif #ifdef ENABLE_VDE " vde" +#endif +#ifdef HAVE_WATCHDOG + " watchdog" #endif "\n\n" "Copyright (C) 1998-2021 Ivo Timmermans, Guus Sliepen and others.\n" @@ -560,7 +566,9 @@ int main(int argc, char **argv) { g_argv = argv; - if(getenv("LISTEN_PID") && atoi(getenv("LISTEN_PID")) == getpid()) { + const char *listen_pid = getenv("LISTEN_PID"); + + if(listen_pid && atoi(listen_pid) == getpid()) { do_detach = false; }