diff options
author | Brett Bryant <bbryant@digium.com> | 2007-06-27 23:30:31 +0000 |
---|---|---|
committer | Brett Bryant <bbryant@digium.com> | 2007-06-27 23:30:31 +0000 |
commit | a17e7a01a3864490be81ef8ba705ce741b237f54 (patch) | |
tree | ce46c8d23893ddb8c6e98ed611708ad43ee448de | |
parent | 150c77c901fe58defa657d9b11b4bf48b38a5586 (diff) |
Merged revisions 72383 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r72383 | bbryant | 2007-06-27 18:29:14 -0500 (Wed, 27 Jun 2007) | 11 lines
Merged revisions 72373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r72373 | bbryant | 2007-06-27 18:22:13 -0500 (Wed, 27 Jun 2007) | 3 lines
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/trunk@72384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/asterisk.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 6a826bf01..eb5654ab4 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -2232,6 +2232,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'; @@ -2958,6 +2961,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'; @@ -2980,5 +2986,6 @@ int main(int argc, char *argv[]) monitor_sig_flags(NULL); +lostterm: return 0; } |