summaryrefslogtreecommitdiff
path: root/app-shells/bash/files/bash-3.0-trap-fg-signals.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/bash/files/bash-3.0-trap-fg-signals.patch')
-rw-r--r--app-shells/bash/files/bash-3.0-trap-fg-signals.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/app-shells/bash/files/bash-3.0-trap-fg-signals.patch b/app-shells/bash/files/bash-3.0-trap-fg-signals.patch
new file mode 100644
index 000000000000..cde18326ed2d
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-trap-fg-signals.patch
@@ -0,0 +1,23 @@
+Don't barf on handled signals inside of scripts. Makes for nicer output.
+
+patch by Martin Schlemmer <azarah@gentoo.org>
+
+--- jobs.c
++++ jobs.c
+@@ -2893,11 +2893,11 @@
+ }
+ else if (IS_FOREGROUND (job))
+ {
+-#if !defined (DONT_REPORT_SIGPIPE)
+- if (termsig && WIFSIGNALED (s) && termsig != SIGINT)
+-#else
+- if (termsig && WIFSIGNALED (s) && termsig != SIGINT && termsig != SIGPIPE)
+-#endif
++ if (termsig && WIFSIGNALED (s) && termsig != SIGINT &&
++#if defined (DONT_REPORT_SIGPIPE)
++ termsig != SIGPIPE &&
++#endif
++ signal_is_trapped (termsig) == 0)
+ {
+ fprintf (stderr, "%s", j_strsignal (termsig));
+