]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add windows daemon mode. Somthing is still not right here, the fopen is failing?
authorMichael Jerris <mike@jerris.com>
Sat, 25 Feb 2006 04:48:33 +0000 (04:48 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 25 Feb 2006 04:48:33 +0000 (04:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@671 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch.c

index 9e8d99b9396a9b9d9b30006a9971ea3f422b3299..50acc1bb0a3072cb66ac98e1dfc984cd46378f7f 100644 (file)
@@ -51,10 +51,10 @@ int main(int argc, char *argv[])
        }
 
        if (bg) {
-               int pid;
 #ifdef WIN32
                char *path = ".\\freeswitch.log";
 #else
+               int pid;
                char *path = "/var/log/freeswitch.log";
                nice(-20);
 #endif
@@ -66,10 +66,14 @@ int main(int argc, char *argv[])
 
                (void) signal(SIGHUP, (void *) handle_SIGHUP);
 
+#ifdef WIN32
+               FreeConsole();
+#else
                if ((pid = fork())) {
                        fprintf(stderr, "%d Backgrounding.\n", (int)pid);
                        exit(0);
                }
+#endif
        }
 
        if (switch_core_init(out) != SWITCH_STATUS_SUCCESS) {