diff options
| author | tgoodwin <tgoodwin> | 1998-07-15 12:39:13 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:08 +0100 |
| commit | 918e8f9b8935ad2034bc0d458c64d5c688b2bab5 (patch) | |
| tree | e8efb99d86b84b10e662d16e1f54a46bc3eb14af /signal.c | |
| parent | 382b7e3f5bc34d78694fdbd8d078dc904979350c (diff) | |
get readline stuff working and pretty(ish)
Diffstat (limited to 'signal.c')
| -rw-r--r-- | signal.c | 48 |
1 files changed, 7 insertions, 41 deletions
@@ -7,11 +7,6 @@ #include "sigmsgs.h" #include "jbwrap.h" -#if HAVE_RESTARTABLE_SYSCALLS || READLINE -Jbwrap slowbuf; -volatile sig_atomic_t slow, interrupt_happened; -#endif - void (*sighandlers[NUMOFSIGNALS])(int); static volatile sig_atomic_t sigcount, caught[NUMOFSIGNALS]; @@ -24,50 +19,21 @@ extern void catcher(int s) { signal(s, catcher); #if READLINE - if (in_readline) { - in_readline = FALSE; - switch (s) { - extern int rl_pending_input; - extern VFunction *rl_deprep_term_function; - - default: -#if READLINE_OLD - rl_clean_up_for_exit(); - rl_deprep_terminal(); -#else - _rl_clean_up_for_exit(); - (*rl_deprep_term_function)(); -#endif - rl_clear_signals(); - rl_pending_input = 0; - break; - -/* These signals are already cleaned up by readline. */ - - case SIGINT: - case SIGALRM: -#ifdef SIGTSTP - case SIGTSTP: - case SIGTTOU: - case SIGTTIN: -#endif - break; - } - } + if (rl_active) + siglongjmp(rl_buf.j, s); #endif /* READLINE */ - -#if HAVE_RESTARTABLE_SYSCALLS || READLINE - interrupt_happened = TRUE; - if (slow) - siglongjmp(slowbuf.j, 1); +#if HAVE_RESTARTABLE_SYSCALLS + if (slow) { + siglongjmp(slowbuf.j, s); +} #endif - } extern void sigchk() { void (*h)(int); int s, i; + if (sigcount == 0) return; /* ho hum; life as usual */ if (forked) |