CharIoStdin: disable SIGINT generation with Ctrl-C.

This commit is contained in:
Maxim Poliakovski 2022-05-07 23:42:33 +02:00
parent 4c9001901e
commit d928d3ff55

View File

@ -80,20 +80,17 @@ int CharIoStdin::rcv_enable()
new_termios.c_cflag &= ~(CSIZE | PARENB);
new_termios.c_cflag |= CS8;
new_termios.c_lflag &= ~(ECHO | ICANON);
new_termios.c_lflag &= ~(ECHO | ICANON | ISIG);
new_termios.c_iflag &= ~(ICRNL);
tcsetattr(STDIN_FILENO, TCSANOW, &new_termios);
// save original signal handler for SIGINT
//struct sigaction new_act;
// then redirect SIGINT to new handler
memset(&new_act, 0, sizeof(new_act));
new_act.sa_handler = mysig_handler;
sigaction(SIGINT, &new_act, &old_act);
// redirect SIGINT to new handler
//signal(SIGINT, mysig_handler);
this->stdio_inited = true;
return 0;