mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 00:00:44 +00:00
win32 tweaks
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2767 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c3757293f0
commit
73b5fcf641
@ -233,8 +233,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
snprintf(path, sizeof(path), "Global\\Freeswitch.%d", getpid());
|
|
||||||
shutdown_event = CreateEvent(NULL, FALSE, FALSE, path);
|
|
||||||
#else
|
#else
|
||||||
if ((pid = fork())) {
|
if ((pid = fork())) {
|
||||||
fprintf(stderr, "%d Backgrounding.\n", (int)pid);
|
fprintf(stderr, "%d Backgrounding.\n", (int)pid);
|
||||||
|
@ -221,13 +221,22 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
if (activity) {
|
if (activity) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "\nfreeswitch@%s> ", hostname);
|
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "\nfreeswitch@%s> ", hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
//Microsofts macros don't pass their own compilers warnings.
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 4127 4389)
|
||||||
|
#endif
|
||||||
|
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_ZERO(&efds);
|
FD_ZERO(&efds);
|
||||||
FD_SET(fileno(stdin), &rfds);
|
FD_SET(fileno(stdin), &rfds);
|
||||||
FD_SET(fileno(stdin), &efds);
|
FD_SET(fileno(stdin), &efds);
|
||||||
activity = select(fileno(stdin)+1, &rfds, NULL, &efds, &tv);
|
activity = select(fileno(stdin)+1, &rfds, NULL, &efds, &tv);
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
if (activity == 0) {
|
if (activity == 0) {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
continue;
|
continue;
|
||||||
|
@ -3511,12 +3511,17 @@ SWITCH_DECLARE(int32_t) set_high_priority(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_runtime_loop(int bg)
|
SWITCH_DECLARE(void) switch_core_runtime_loop(int bg)
|
||||||
{
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
HANDLE shutdown_event;
|
||||||
|
char path[256] = "";
|
||||||
|
#endif
|
||||||
if (bg) {
|
if (bg) {
|
||||||
bg = 0;
|
bg = 0;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
snprintf(path, sizeof(path), "Global\\Freeswitch.%d", getpid());
|
||||||
|
shutdown_event = CreateEvent(NULL, FALSE, FALSE, path);
|
||||||
WaitForSingleObject(shutdown_event, INFINITE);
|
WaitForSingleObject(shutdown_event, INFINITE);
|
||||||
#else
|
#else
|
||||||
runtime.running = 1;
|
runtime.running = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user