Merged revisions 72259 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72259 | bbryant | 2007-06-27 15:43:53 -0500 (Wed, 27 Jun 2007) | 4 lines

Fixes 100% load when controlling terminal disappears.

Issue #9654, #10010

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Brett Bryant 18 years ago
parent a61fb24363
commit b2cc514f08

@ -2282,6 +2282,9 @@ static void ast_remotecontrol(char * data)
for (;;) { for (;;) {
ebuf = (char *)el_gets(el, &num); ebuf = (char *)el_gets(el, &num);
if (!ebuf && write(1, "", 1) < 0)
break;
if (!ast_strlen_zero(ebuf)) { if (!ast_strlen_zero(ebuf)) {
if (ebuf[strlen(ebuf)-1] == '\n') if (ebuf[strlen(ebuf)-1] == '\n')
ebuf[strlen(ebuf)-1] = '\0'; ebuf[strlen(ebuf)-1] = '\0';
@ -2956,6 +2959,10 @@ int main(int argc, char *argv[])
for (;;) { for (;;) {
buf = (char *)el_gets(el, &num); buf = (char *)el_gets(el, &num);
if (!buf && write(1, "", 1) < 0)
goto lostterm;
if (buf) { if (buf) {
if (buf[strlen(buf)-1] == '\n') if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0'; buf[strlen(buf)-1] = '\0';
@ -2978,5 +2985,6 @@ int main(int argc, char *argv[])
monitor_sig_flags(NULL); monitor_sig_flags(NULL);
lostterm:
return 0; return 0;
} }

Loading…
Cancel
Save