#include "names.h"
#include "net.h"
#include "netutl.h"
-#include "process.h"
#include "protocol.h"
#include "utils.h"
#include "xalloc.h"
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]);
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! */
}
#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.