X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=sig.c;h=e876a2b26747b83e21eaaf6805e3bacf20c79db4;hb=89a92869e56aba4e4cab2d639c00a86f0545c862;hp=f9beee144d98500043f73ece0715d388c4a60496;hpb=17345e5ad288f7543b77b23a25aa380eacc279f2;p=platform%2Fupstream%2Fbash.git 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? */