diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c index af544cfe4..a48897e53 100644 --- a/lib/tty/tty-ncurses.c +++ b/lib/tty/tty-ncurses.c @@ -92,11 +92,13 @@ tty_setup_sigwinch (void (*handler) (int)) { #if (NCURSES_VERSION_MAJOR >= 4) && defined (SIGWINCH) struct sigaction act, oact; + act.sa_handler = handler; sigemptyset (&act.sa_mask); - act.sa_flags = 0; #ifdef SA_RESTART - act.sa_flags |= SA_RESTART; + act.sa_flags = SA_RESTART; +#else + act.sa_flags = 0; #endif /* SA_RESTART */ sigaction (SIGWINCH, &act, &oact); #endif /* SIGWINCH */ diff --git a/lib/tty/tty-slang.c b/lib/tty/tty-slang.c index 14c1aae9f..e03637d00 100644 --- a/lib/tty/tty-slang.c +++ b/lib/tty/tty-slang.c @@ -61,10 +61,6 @@ extern int reset_hp_softkeys; /*** file scope macro definitions ****************************************************************/ -#ifndef SA_RESTART -#define SA_RESTART 0 -#endif - #ifndef SLTT_MAX_SCREEN_COLS #define SLTT_MAX_SCREEN_COLS 512 #endif diff --git a/lib/tty/tty.c b/lib/tty/tty.c index c803e1c75..7a695f58d 100644 --- a/lib/tty/tty.c +++ b/lib/tty/tty.c @@ -120,7 +120,11 @@ tty_start_interrupt_key (void) act.sa_handler = sigintr_handler; sigemptyset (&act.sa_mask); +#ifdef SA_RESTART act.sa_flags = SA_RESTART; +#else + act.sa_flags = 0; +#endif /* SA_RESTART */ sigaction (SIGINT, &act, NULL); }