Clarify usage of SA_RESTART.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2013-09-29 10:59:47 +04:00
parent c26c3cc4fd
commit 6a05f30ecf
3 changed files with 8 additions and 6 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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);
}