From 35fd48a0b48879dd29b17bc263903907ea1ba345 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 27 Oct 2000 18:37:32 +0000 Subject: [PATCH] use sigaction() instead of signal(). With some OSes the signal handler is set back to default after each time signal is raised if signal() is used (by norpan). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@790 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/screen.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fe-text/screen.c b/src/fe-text/screen.c index b2e41c44..1dc33b64 100644 --- a/src/fe-text/screen.c +++ b/src/fe-text/screen.c @@ -111,6 +111,7 @@ static int init_curses(void) { char ansi_tab[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; int num; + struct sigaction act; if (!initscr()) return FALSE; @@ -118,9 +119,13 @@ static int init_curses(void) if (COLS < MIN_SCREEN_WIDTH) COLS = MIN_SCREEN_WIDTH; - signal(SIGINT, sigint_handler); + sigemptyset (&act.sa_mask); + act.sa_flags = 0; + act.sa_handler = sigint_handler; + sigaction(SIGINT, &act, NULL); #ifdef SIGWINCH - signal(SIGWINCH, sig_winch); + act.sa_handler = sig_winch; + sigaction(SIGWINCH, &act, NULL); #endif cbreak(); noecho(); idlok(stdscr, 1); #ifdef HAVE_CURSES_IDCOK