mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Merge branch '1404_ctrc_kills_mc'
* 1404_ctrc_kills_mc: Ticket #1404: Ctrl-C kills mc.
This commit is contained in:
commit
bd8f0f2c0b
@ -2306,6 +2306,9 @@ main (int argc, char *argv[])
|
||||
#ifdef HAVE_SLANG
|
||||
slang_init ();
|
||||
#endif
|
||||
|
||||
start_interrupt_key ();
|
||||
|
||||
/* NOTE: This call has to be after slang_init. It's the small part from
|
||||
the previous init_key which had to be moved after the call of slang_init */
|
||||
init_key_input_fd ();
|
||||
|
13
src/tty.c
13
src/tty.c
@ -69,16 +69,27 @@ sigintr_handler(int signo)
|
||||
|
||||
/*** public functions **************************************************/
|
||||
|
||||
extern void
|
||||
tty_start_interrupt_key(void)
|
||||
{
|
||||
struct sigaction act;
|
||||
|
||||
act.sa_handler = sigintr_handler;
|
||||
sigemptyset (&act.sa_mask);
|
||||
act.sa_flags = SA_RESTART;
|
||||
sigaction (SIGINT, &act, NULL);
|
||||
}
|
||||
|
||||
extern void
|
||||
tty_enable_interrupt_key(void)
|
||||
{
|
||||
struct sigaction act;
|
||||
|
||||
got_interrupt = 0;
|
||||
act.sa_handler = sigintr_handler;
|
||||
sigemptyset (&act.sa_mask);
|
||||
act.sa_flags = 0;
|
||||
sigaction (SIGINT, &act, NULL);
|
||||
got_interrupt = 0;
|
||||
}
|
||||
|
||||
extern void
|
||||
|
@ -40,6 +40,7 @@
|
||||
|
||||
/* {{{ Input }}} */
|
||||
|
||||
extern void tty_start_interrupt_key(void);
|
||||
extern void tty_enable_interrupt_key(void);
|
||||
extern void tty_disable_interrupt_key(void);
|
||||
extern gboolean tty_got_interrupt(void);
|
||||
@ -70,6 +71,7 @@ extern char *tty_tgetstr (const char *name);
|
||||
|
||||
/* legacy interface */
|
||||
|
||||
#define start_interrupt_key() tty_start_interrupt_key()
|
||||
#define enable_interrupt_key() tty_enable_interrupt_key()
|
||||
#define disable_interrupt_key() tty_disable_interrupt_key()
|
||||
#define got_interrupt() tty_got_interrupt()
|
||||
|
Loading…
Reference in New Issue
Block a user