summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_sigaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_sigaction.c')
-rw-r--r--lib/libpthread/thread/thr_sigaction.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_sigaction.c b/lib/libpthread/thread/thr_sigaction.c
index 7ee0ce6..bc54a86 100644
--- a/lib/libpthread/thread/thr_sigaction.c
+++ b/lib/libpthread/thread/thr_sigaction.c
@@ -75,7 +75,7 @@ _sigaction(int sig, const struct sigaction * act, struct sigaction * oact)
* Check if the kernel needs to be advised of a change
* in signal action:
*/
- if (act != NULL && sig != SIGINFO) {
+ if (act != NULL) {
newact.sa_flags |= SA_SIGINFO;
@@ -91,6 +91,16 @@ _sigaction(int sig, const struct sigaction * act, struct sigaction * oact)
*/
newact.sa_handler = (void (*) ())_thr_sig_handler;
}
+ /*
+ * Install libpthread signal handler wrapper
+ * for SIGINFO signal if threads dump enabled
+ * even if a user set the signal handler to
+ * SIG_DFL or SIG_IGN.
+ */
+ if (sig == SIGINFO && _thr_dump_enabled()) {
+ newact.sa_handler =
+ (void (*) ())_thr_sig_handler;
+ }
/* Change the signal action in the kernel: */
if (__sys_sigaction(sig, &newact, NULL) != 0) {
_thread_sigact[sig - 1] = oldact;
OpenPOWER on IntegriCloud