aboutsummaryrefslogtreecommitdiffstats
path: root/sig.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-21 20:49:12 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-21 20:49:12 -0500
commit89a92869e56aba4e4cab2d639c00a86f0545c862 (patch)
treee1cd4da50318af8ab1f3141d39d4b0b8e1e7c500 /sig.c
parent17345e5ad288f7543b77b23a25aa380eacc279f2 (diff)
downloadandroid_external_bash-89a92869e56aba4e4cab2d639c00a86f0545c862.tar.gz
android_external_bash-89a92869e56aba4e4cab2d639c00a86f0545c862.tar.bz2
android_external_bash-89a92869e56aba4e4cab2d639c00a86f0545c862.zip
Bash-4.0 patchlevel 38
Diffstat (limited to 'sig.c')
-rw-r--r--sig.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/sig.c b/sig.c
index f9beee1..e876a2b 100644
--- a/sig.c
+++ b/sig.c
@@ -448,6 +448,48 @@ sighandler
termsig_sighandler (sig)
int sig;
{
+ /* If we get called twice with the same signal before handling it,
+ terminate right away. */
+ if (
+#ifdef SIGHUP
+ sig != SIGHUP &&
+#endif
+#ifdef SIGINT
+ sig != SIGINT &&
+#endif
+#ifdef SIGDANGER
+ sig != SIGDANGER &&
+#endif
+#ifdef SIGPIPE
+ sig != SIGPIPE &&
+#endif
+#ifdef SIGALRM
+ sig != SIGALRM &&
+#endif
+#ifdef SIGTERM
+ sig != SIGTERM &&
+#endif
+#ifdef SIGXCPU
+ sig != SIGXCPU &&
+#endif
+#ifdef SIGXFSZ
+ sig != SIGXFSZ &&
+#endif
+#ifdef SIGVTALRM
+ sig != SIGVTALRM &&
+#endif
+#ifdef SIGLOST
+ sig != SIGLOST &&
+#endif
+#ifdef SIGUSR1
+ sig != SIGUSR1 &&
+#endif
+#ifdef SIGUSR2
+ sig != SIGUSR2 &&
+#endif
+ sig == terminating_signal)
+ terminate_immediately = 1;
+
terminating_signal = sig;
/* XXX - should this also trigger when interrupt_immediately is set? */