diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-12-12 22:04:26 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-12-12 22:04:26 +0000 |
commit | 5e034d9f0bb194a0ac6b4e69dc9c106b7468df6c (patch) | |
tree | 887891879ee7f56f5ce6da00db9af1e9958201d3 /main | |
parent | afceccd015b585c1b1ae1cd27ca1b5f10d8b65a0 (diff) |
Merged revisions 163761 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r163761 | tilghman | 2008-12-12 16:03:10 -0600 (Fri, 12 Dec 2008) | 7 lines
Simple fix for Ctrl-C not immediately exiting Asterisk, but also add a
pointer inside editline to look back to asterisk.c, so others don't spend
as much time as I did looking (in the wrong place) for the appropriate
function.
Reported by: ZX81, via the #asterisk-users channel
Fixed by: me (license 14)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 2 | ||||
-rw-r--r-- | main/editline/read.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 6ef1c65a0..c002a4542 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1943,6 +1943,8 @@ static int ast_el_read_char(EditLine *editline, char *cp) } res = poll(fds, max, -1); if (res < 0) { + if (sig_flags.need_quit) + break; if (errno == EINTR) continue; ast_log(LOG_ERROR, "poll failed: %s\n", strerror(errno)); diff --git a/main/editline/read.c b/main/editline/read.c index ccd0a06e5..80d51da4a 100644 --- a/main/editline/read.c +++ b/main/editline/read.c @@ -286,6 +286,8 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, char *ch) /* read_char(): * Read a character from the tty. + * XXX This routine is the default, but what you are actually looking for + * is in main/asterisk.c, in ast_el_read_char(). XXX */ private int read_char(EditLine *el, char *cp) @@ -344,6 +346,7 @@ el_getc(EditLine *el, char *cp) #ifdef DEBUG_READ (void) fprintf(el->el_errfile, "Reading a character\n"); #endif /* DEBUG_READ */ + /* See main/asterisk.c: ast_el_read_char() */ num_read = (*el->el_read.read_char)(el, cp); #ifdef DEBUG_READ (void) fprintf(el->el_errfile, "Got it %c\n", *cp); |