mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-31 18:55:49 +00:00
use WaitForSingleObject for the console loop to wait on stdin on the windows build, as the select was not working properly.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4247 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
0c34702513
commit
c0a362d156
@ -199,8 +199,10 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
|
|
||||||
while(running) {
|
while(running) {
|
||||||
uint32_t arg;
|
uint32_t arg;
|
||||||
|
#ifndef _MSC_VER
|
||||||
fd_set rfds, efds;
|
fd_set rfds, efds;
|
||||||
struct timeval tv = {0, 20000};
|
struct timeval tv = {0, 20000};
|
||||||
|
#endif
|
||||||
|
|
||||||
switch_core_session_ctl(SCSC_CHECK_RUNNING, &arg);
|
switch_core_session_ctl(SCSC_CHECK_RUNNING, &arg);
|
||||||
if (!arg) {
|
if (!arg) {
|
||||||
@ -210,13 +212,14 @@ 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
|
#ifdef _MSC_VER
|
||||||
//Microsofts macros don't pass their own compilers warnings.
|
activity = WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE),20);
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable: 4127 4389)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
if (activity == 102) {
|
||||||
|
fflush(stdout);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#else
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_ZERO(&efds);
|
FD_ZERO(&efds);
|
||||||
FD_SET(fileno(stdin), &rfds);
|
FD_SET(fileno(stdin), &rfds);
|
||||||
@ -225,14 +228,12 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(pop)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (activity == 0) {
|
if (activity == 0) {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
for (x = 0; x < (sizeof(cmd)-1); x++) {
|
for (x = 0; x < (sizeof(cmd)-1); x++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user