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:
parent
d4579742cf
commit
35fd48a0b4
@ -111,6 +111,7 @@ static int init_curses(void)
|
|||||||
{
|
{
|
||||||
char ansi_tab[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
|
char ansi_tab[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
|
||||||
int num;
|
int num;
|
||||||
|
struct sigaction act;
|
||||||
|
|
||||||
if (!initscr())
|
if (!initscr())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -118,9 +119,13 @@ static int init_curses(void)
|
|||||||
if (COLS < MIN_SCREEN_WIDTH)
|
if (COLS < MIN_SCREEN_WIDTH)
|
||||||
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
|
#ifdef SIGWINCH
|
||||||
signal(SIGWINCH, sig_winch);
|
act.sa_handler = sig_winch;
|
||||||
|
sigaction(SIGWINCH, &act, NULL);
|
||||||
#endif
|
#endif
|
||||||
cbreak(); noecho(); idlok(stdscr, 1);
|
cbreak(); noecho(); idlok(stdscr, 1);
|
||||||
#ifdef HAVE_CURSES_IDCOK
|
#ifdef HAVE_CURSES_IDCOK
|
||||||
|
Loading…
Reference in New Issue
Block a user