summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-editors/nano/files/nanohupterm.patch')
-rw-r--r--app-editors/nano/files/nanohupterm.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/app-editors/nano/files/nanohupterm.patch b/app-editors/nano/files/nanohupterm.patch
new file mode 100644
index 000000000000..97e7a7717377
--- /dev/null
+++ b/app-editors/nano/files/nanohupterm.patch
@@ -0,0 +1,16 @@
+diff -ur nano/src/nano.c nano-fixed/src/nano.c
+--- nano/src/nano.c 2003-09-28 17:26:49.000000000 -0400
++++ nano-fixed/src/nano.c 2003-09-29 01:18:16.000000000 -0400
+@@ -2852,6 +2852,12 @@
+ /* Restore the terminal settings for the disabled keys */
+ tcsetattr(0, TCSANOW, &oldterm);
+
++ /* Trap SIGHUP and SIGTERM so we can properly deal with them while
++ suspended */
++ act.sa_handler = handle_hupterm;
++ sigaction(SIGHUP, &act, NULL);
++ sigaction(SIGTERM, &act, NULL);
++
+ /* We used to re-enable the default SIG_DFL and raise SIGTSTP, but
+ then we could be (and were) interrupted in the middle of the call.
+ So we do it the mutt way instead */