提交 5782ca92 authored 作者: Michael Jerris's avatar Michael Jerris

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
上级 5cd80803
...@@ -51,10 +51,10 @@ int main(int argc, char *argv[]) ...@@ -51,10 +51,10 @@ int main(int argc, char *argv[])
} }
if (bg) { if (bg) {
int pid;
#ifdef WIN32 #ifdef WIN32
char *path = ".\\freeswitch.log"; char *path = ".\\freeswitch.log";
#else #else
int pid;
char *path = "/var/log/freeswitch.log"; char *path = "/var/log/freeswitch.log";
nice(-20); nice(-20);
#endif #endif
...@@ -66,10 +66,14 @@ int main(int argc, char *argv[]) ...@@ -66,10 +66,14 @@ int main(int argc, char *argv[])
(void) signal(SIGHUP, (void *) handle_SIGHUP); (void) signal(SIGHUP, (void *) handle_SIGHUP);
#ifdef WIN32
FreeConsole();
#else
if ((pid = fork())) { if ((pid = fork())) {
fprintf(stderr, "%d Backgrounding.\n", (int)pid); fprintf(stderr, "%d Backgrounding.\n", (int)pid);
exit(0); exit(0);
} }
#endif
} }
if (switch_core_init(out) != SWITCH_STATUS_SUCCESS) { if (switch_core_init(out) != SWITCH_STATUS_SUCCESS) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论