mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
ctl-d crap (i still would not recommend doing it
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3729 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8d3d259d12
commit
d5acc6493c
@ -224,11 +224,14 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
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);
|
if ((activity = select(fileno(stdin)+1, &rfds, NULL, &efds, &tv)) < 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (activity == 0) {
|
if (activity == 0) {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
continue;
|
continue;
|
||||||
@ -236,7 +239,15 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
|
|
||||||
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++) {
|
||||||
cmd[x] = (char) getchar();
|
int c = getchar();
|
||||||
|
if (c < 0) {
|
||||||
|
int y = read(fileno(stdin), cmd, sizeof(cmd));
|
||||||
|
cmd[y-1] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd[x] = (char) c;
|
||||||
|
|
||||||
if (cmd[x] == '\n') {
|
if (cmd[x] == '\n') {
|
||||||
cmd[x] = '\0';
|
cmd[x] = '\0';
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user