X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Ftincd.c;fp=src%2Ftincd.c;h=3d521e5cfdc4b2f9997150b6bab8e80766bad9b6;hb=a3c7e1ce23cd7502f0461354fc6cb2b16f39ed96;hp=57d18c7089ac45e54606c53541e83364af9511d2;hpb=084ba04f51441098c55d3bd21b11bbe368e7b52e;p=meshlink diff --git a/src/tincd.c b/src/tincd.c index 57d18c70..3d521e5c 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -51,7 +51,6 @@ #include "names.h" #include "net.h" #include "netutl.h" -#include "process.h" #include "protocol.h" #include "utils.h" #include "xalloc.h" @@ -152,10 +151,6 @@ static bool parse_options(int argc, char **argv) { confbase = xstrdup(optarg); break; - case 'D': /* no detach */ - do_detach = false; - break; - case 'L': /* no detach */ #ifndef HAVE_MLOCKALL logger(DEBUG_ALWAYS, LOG_ERR, "The %s option is not supported on this platform.", argv[optind - 1]); @@ -344,12 +339,6 @@ int main(int argc, char **argv) { g_argv = argv; - if(getenv("LISTEN_PID") && atoi(getenv("LISTEN_PID")) == getpid()) - do_detach = false; -#ifdef HAVE_UNSETENV - unsetenv("LISTEN_PID"); -#endif - init_configuration(&config_tree); /* Slllluuuuuuurrrrp! */ @@ -368,22 +357,8 @@ int main(int argc, char **argv) { } #endif -#ifdef HAVE_MINGW - if(!do_detach || !init_service()) - return main2(argc, argv); - else - return 1; -} - -int main2(int argc, char **argv) { - InitializeCriticalSection(&mutex); - EnterCriticalSection(&mutex); -#endif char *priority = NULL; - if(!detach()) - return 1; - #ifdef HAVE_MLOCKALL /* Lock all pages into memory if requested. * This has to be done after daemon()/fork() so it works for child.