commit: a930fa7a97375463d02cde833f6f31c5aef479e9
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jun 11 08:49:19 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 11 08:51:42 2023 +0000
URL:
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=a930fa7a
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 <AT> plushkava.net>
ecma48-cpr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/ecma48-cpr.c b/ecma48-cpr.c
index 7d32c63..5a0f936 100644
--- a/ecma48-cpr.c
+++ b/ecma48-cpr.c
@@ -99,6 +99,13 @@ main(void) {
sigaction(SIGALRM, &act, NULL);
+ /*
+ * 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.
*/