diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-12-08 22:31:39 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-12-08 22:31:39 +0000 |
commit | 9255ee3150832d7e235fc0711f0efa70700559e7 (patch) | |
tree | 97d578647cc7f257e42ce12fa74e570b783ee0b9 /readline/signals.c | |
parent | ffbceea9fb49e8dd28c88a4b59cf8616b2dcc210 (diff) | |
download | gdb-9255ee3150832d7e235fc0711f0efa70700559e7.zip gdb-9255ee3150832d7e235fc0711f0efa70700559e7.tar.gz gdb-9255ee3150832d7e235fc0711f0efa70700559e7.tar.bz2 |
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
Diffstat (limited to 'readline/signals.c')
-rw-r--r-- | readline/signals.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/readline/signals.c b/readline/signals.c index 283a115..9deb076 100644 --- a/readline/signals.c +++ b/readline/signals.c @@ -61,7 +61,7 @@ # define SIGHANDLER_RETURN return (0) #endif -/* This typedef is equivalant to the one for Function; it allows us +/* This typedef is equivalent to the one for Function; it allows us to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */ typedef RETSIGTYPE SigHandler (); @@ -73,7 +73,8 @@ typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt # define sigemptyset(m) #endif /* !HAVE_POSIX_SIGNALS */ -static SigHandler *rl_set_sighandler __P((int, SigHandler *, sighandler_cxt *)); +static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); +static void rl_maybe_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); /* Exported variables for use by applications. */ @@ -121,6 +122,8 @@ rl_signal_handler (sig) # endif /* !HAVE_BSD_SIGNALS */ #endif /* !HAVE_POSIX_SIGNALS */ + RL_SETSTATE(RL_STATE_SIGHANDLER); + #if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS) /* Since the signal will not be blocked while we are in the signal handler, ignore it until rl_clear_signals resets the catcher. */ @@ -171,6 +174,7 @@ rl_signal_handler (sig) rl_reset_after_signal (); } + RL_UNSETSTATE(RL_STATE_SIGHANDLER); SIGHANDLER_RETURN; } @@ -191,6 +195,7 @@ rl_sigwinch_handler (sig) rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch); #endif + RL_SETSTATE(RL_STATE_SIGHANDLER); rl_resize_terminal (); /* If another sigwinch handler has been installed, call it. */ @@ -198,6 +203,7 @@ rl_sigwinch_handler (sig) if (oh && oh != (SigHandler *)SIG_IGN && oh != (SigHandler *)SIG_DFL) (*oh) (sig); + RL_UNSETSTATE(RL_STATE_SIGHANDLER); SIGHANDLER_RETURN; } #endif /* SIGWINCH */ @@ -229,7 +235,7 @@ rl_set_sighandler (sig, handler, ohandler) struct sigaction act; act.sa_handler = handler; - act.sa_flags = 0; + act.sa_flags = 0; /* XXX - should we set SA_RESTART for SIGWINCH? */ sigemptyset (&act.sa_mask); sigemptyset (&ohandler->sa_mask); sigaction (sig, &act, &old_handler); @@ -360,7 +366,7 @@ rl_cleanup_after_signal () _rl_clean_up_for_exit (); (*rl_deprep_term_function) (); rl_clear_signals (); - rl_pending_input = 0; + rl_clear_pending_input (); } /* Reset the terminal and readline state after a signal handler returns. */ @@ -380,7 +386,7 @@ rl_free_line_state () { register HIST_ENTRY *entry; - free_undo_list (); + rl_free_undo_list (); entry = current_history (); if (entry) |