1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

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
This commit is contained in:
Timo Sirainen 2000-10-27 18:37:32 +00:00 committed by cras
parent d4579742cf
commit 35fd48a0b4

View File

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