]> git.meshlink.io Git - meshlink/blobdiff - src/tincd.c
Disable support for detaching from the foreground.
[meshlink] / src / tincd.c
index 57d18c7089ac45e54606c53541e83364af9511d2..3d521e5cfdc4b2f9997150b6bab8e80766bad9b6 100644 (file)
@@ -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.