From e3ac7c50acf8c28225f584e7088d86eaaa68367d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 27 Mar 2013 16:50:10 -0500 Subject: [PATCH] FS-5238 --resolve --- src/switch.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/switch.c b/src/switch.c index f86b080996..68f6af341d 100644 --- a/src/switch.c +++ b/src/switch.c @@ -929,16 +929,6 @@ int main(int argc, char *argv[]) } #endif - if (nc) { -#ifdef WIN32 - FreeConsole(); -#else - if (!nf) { - daemonize(do_wait); - } -#endif - } - switch (priority) { case 2: set_realtime_priority(); @@ -956,7 +946,6 @@ int main(int argc, char *argv[]) switch_core_setrlimits(); - #ifndef WIN32 if (runas_user || runas_group) { if (change_user_group(runas_user, runas_group) < 0) { @@ -966,7 +955,19 @@ int main(int argc, char *argv[]) return 255; } } +#endif + + if (nc) { +#ifdef WIN32 + FreeConsole(); #else + if (!nf) { + daemonize(do_wait); + } +#endif + } + +#ifdef WIN32 if (win32_service) { /* Attempt to start service */ SERVICE_TABLE_ENTRY dispatchTable[] = {