]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Simple fix for Ctrl-C not immediately exiting Asterisk, but also add a
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 12 Dec 2008 22:03:10 +0000 (22:03 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 12 Dec 2008 22:03:10 +0000 (22:03 +0000)
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/branches/1.4@163761 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c
main/editline/read.c

index 3dad454d5bf5da23601b901f5c40541e689cec5b..3ed7fff225de727ec1f2138b45fa0a3362520e08 100644 (file)
@@ -1777,6 +1777,8 @@ static int ast_el_read_char(EditLine *el, 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));
index ccd0a06e5992c4c547ca1c2a51c6431b61810b14..80d51da4a79f8b7b114a9d590c82d462c7dd839a 100644 (file)
@@ -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);