From: Brett Bryant Date: Wed, 27 Jun 2007 23:22:13 +0000 (+0000) Subject: Reinstating patch. This actually fixes the problem, however I was running a developme... X-Git-Tag: 1.2.20~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcdfb4aa89c38a442267433802a162288e2e904b;p=thirdparty%2Fasterisk.git Reinstating patch. This actually fixes the problem, however I was running a development branch without it and mistakenly thought it wasn't fixed. Fixes issue #10010, and #9654: 100% CPU usage caused by an asterisk console losing it's controlling terminal. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@72373 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/asterisk.c b/asterisk.c index 707cce8112..c7acd01280 100644 --- a/asterisk.c +++ b/asterisk.c @@ -1816,6 +1816,9 @@ static void ast_remotecontrol(char * data) for(;;) { ebuf = (char *)el_gets(el, &num); + if (!ebuf && write(1, "", 1) < 0) + break; + if (!ast_strlen_zero(ebuf)) { if (ebuf[strlen(ebuf)-1] == '\n') ebuf[strlen(ebuf)-1] = '\0'; @@ -2458,6 +2461,9 @@ int main(int argc, char *argv[]) for (;;) { buf = (char *)el_gets(el, &num); + if (!buf && write(1, "", 1) < 0) + goto lostterm; + if (buf) { if (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; @@ -2482,5 +2488,6 @@ int main(int argc, char *argv[]) monitor_sig_flags(NULL); +lostterm: return 0; }