diff options
author | Kerin Millar <kfm@plushkava.net> | 2023-06-11 09:49:19 +0100 |
---|---|---|
committer | Kerin Millar <kfm@plushkava.net> | 2023-06-11 09:51:42 +0100 |
commit | a930fa7a97375463d02cde833f6f31c5aef479e9 (patch) | |
tree | 14529498a1e7e8e7e281ae1be1554ca0f07da8e6 | |
parent | ecma48-cpr: Disable flow control in the terminal (diff) | |
download | gentoo-functions-a930fa7a97375463d02cde833f6f31c5aef479e9.tar.gz gentoo-functions-a930fa7a97375463d02cde833f6f31c5aef479e9.tar.bz2 gentoo-functions-a930fa7a97375463d02cde833f6f31c5aef479e9.zip |
ecma48-cpr: Ignore SIGINT, SIGTERM and SIGTSTP
There seems little sense in honouring these signals at the point that
the terminal settings are about to be altered and the CPR sequence
written.
Signed-off-by: Kerin Millar <kfm@plushkava.net>
-rw-r--r-- | ecma48-cpr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ecma48-cpr.c b/ecma48-cpr.c index 7d32c63..5a0f936 100644 --- a/ecma48-cpr.c +++ b/ecma48-cpr.c @@ -100,6 +100,13 @@ main(void) { /* + * Ignore the signals most likely to interrupt the process from hereon. + */ + signal(SIGINT, SIG_IGN); + signal(SIGTERM, SIG_IGN); + signal(SIGTSTP, SIG_IGN); + + /* * Try to apply the new terminal settings. */ if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &new_tty) != 0) { |