1
1

tweaks: rename two functions, to better describe what they do

Этот коммит содержится в:
Benno Schulenberg 2019-05-27 17:24:35 +02:00
родитель f21b094dad
Коммит 6dcfcd11ce
3 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -1054,7 +1054,7 @@ RETSIGTYPE make_a_note(int signal)
void install_handler_for_Ctrl_C(void) void install_handler_for_Ctrl_C(void)
{ {
/* Enable the generation of a SIGINT when ^C is pressed. */ /* Enable the generation of a SIGINT when ^C is pressed. */
enable_signals(); enable_kb_interrupt();
/* Set up a signal handler so that pressing ^C will set a flag. */ /* Set up a signal handler so that pressing ^C will set a flag. */
newaction.sa_handler = make_a_note; newaction.sa_handler = make_a_note;
@ -1066,7 +1066,7 @@ void install_handler_for_Ctrl_C(void)
void restore_handler_for_Ctrl_C(void) void restore_handler_for_Ctrl_C(void)
{ {
sigaction(SIGINT, &oldaction, NULL); sigaction(SIGINT, &oldaction, NULL);
disable_signals(); disable_kb_interrupt();
} }
/* Read whatever comes from standard input into a new buffer. */ /* Read whatever comes from standard input into a new buffer. */
@ -1396,7 +1396,7 @@ void disable_extended_io(void)
} }
/* Stop ^C from generating a SIGINT. */ /* Stop ^C from generating a SIGINT. */
void disable_signals(void) void disable_kb_interrupt(void)
{ {
#ifdef HAVE_TERMIOS_H #ifdef HAVE_TERMIOS_H
struct termios term = {0}; struct termios term = {0};
@ -1408,7 +1408,7 @@ void disable_signals(void)
} }
/* Make ^C generate a SIGINT. */ /* Make ^C generate a SIGINT. */
void enable_signals(void) void enable_kb_interrupt(void)
{ {
#ifdef HAVE_TERMIOS_H #ifdef HAVE_TERMIOS_H
struct termios term = {0}; struct termios term = {0};
@ -1472,7 +1472,7 @@ void terminal_init(void)
if (ISSET(PRESERVE)) if (ISSET(PRESERVE))
enable_flow_control(); enable_flow_control();
disable_signals(); disable_kb_interrupt();
#ifdef USE_SLANG #ifdef USE_SLANG
if (!ISSET(PRESERVE)) if (!ISSET(PRESERVE))
disable_flow_control(); disable_flow_control();

Просмотреть файл

@ -430,8 +430,8 @@ RETSIGTYPE handle_sigwinch(int signal);
void regenerate_screen(void); void regenerate_screen(void);
void do_toggle(int flag); void do_toggle(int flag);
#endif #endif
void disable_signals(void); void disable_kb_interrupt(void);
void enable_signals(void); void enable_kb_interrupt(void);
void disable_flow_control(void); void disable_flow_control(void);
void enable_flow_control(void); void enable_flow_control(void);
void terminal_init(void); void terminal_init(void);

Просмотреть файл

@ -1036,7 +1036,7 @@ bool execute_command(const char *command)
/* Re-enable interpretation of the special control keys so that we get /* Re-enable interpretation of the special control keys so that we get
* SIGINT when Ctrl-C is pressed. */ * SIGINT when Ctrl-C is pressed. */
enable_signals(); enable_kb_interrupt();
/* Set up a signal handler so that ^C will terminate the forked process. */ /* Set up a signal handler so that ^C will terminate the forked process. */
newaction.sa_handler = cancel_the_command; newaction.sa_handler = cancel_the_command;