diff options
Diffstat (limited to 'cmd-line-utils/readline/signals.c')
-rw-r--r-- | cmd-line-utils/readline/signals.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd-line-utils/readline/signals.c b/cmd-line-utils/readline/signals.c index 4609598ff98..8e9c0ae60e5 100644 --- a/cmd-line-utils/readline/signals.c +++ b/cmd-line-utils/readline/signals.c @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> /* Just for NULL. Yuck. */ #include <sys/types.h> @@ -71,6 +73,10 @@ typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt # define sigemptyset(m) #endif /* !HAVE_POSIX_SIGNALS */ +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif + static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); static void rl_maybe_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); @@ -83,6 +89,8 @@ int rl_catch_signals = 1; /* If non-zero, readline will install a signal handler for SIGWINCH. */ #ifdef SIGWINCH int rl_catch_sigwinch = 1; +#else +int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */ #endif static int signals_set_flag; @@ -231,7 +239,7 @@ rl_set_sighandler (sig, handler, ohandler) struct sigaction act; act.sa_handler = handler; - act.sa_flags = 0; /* XXX - should we set SA_RESTART for SIGWINCH? */ + act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0; sigemptyset (&act.sa_mask); sigemptyset (&ohandler->sa_mask); sigaction (sig, &act, &old_handler); |