aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-27 23:29:14 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-27 23:29:14 +0000
commit50a51c58f2fd02ef2fd3ae77d95d4891b632e848 (patch)
treec60af9d4fd79d69f054ff1bc5a6159e6727582ae /main
parentee7db2df268630bae835241125888b0616d33935 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@72383 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 9f8bb3de2..df4b55b72 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2282,6 +2282,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';
@@ -2957,6 +2960,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';
@@ -2979,5 +2985,6 @@ int main(int argc, char *argv[])
monitor_sig_flags(NULL);
+lostterm:
return 0;
}