mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Ticket #1404: Ctrl-C kills mc.
If MC built with --without-subshell option is run with -d option, the Ctrl-C key combination closes MC. Such behaviour was introduced in66332a4fb1
commit. This commit actually restores the SIGINT signal handling which was before66332a4fb1
commit. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ff31f67d6b
commit
c6812961cc
@ -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