From 5782ca928ce9219404c005c7df8181eb62e302a3 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sat, 25 Feb 2006 04:48:33 +0000 Subject: [PATCH] add windows daemon mode. Somthing is still not right here, the fopen is failing? git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@671 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/switch.c b/src/switch.c index 9e8d99b939..50acc1bb0a 100644 --- a/src/switch.c +++ b/src/switch.c @@ -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) {