diff options
author | maxim <maxim@FreeBSD.org> | 2006-06-09 14:23:40 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-06-09 14:23:40 +0000 |
commit | 7b9c5e1df6503fe2de55b89754f8cf3cf2a1735a (patch) | |
tree | 4cc59b7fbcf327d22eafb5278b6b45f6ad0a4b52 /lib/libpthread/thread/thr_sigaction.c | |
parent | f39caee822f1504e4b901a537c04cece488995a1 (diff) | |
download | FreeBSD-src-7b9c5e1df6503fe2de55b89754f8cf3cf2a1735a.zip FreeBSD-src-7b9c5e1df6503fe2de55b89754f8cf3cf2a1735a.tar.gz |
o Remove a cruft prevented libpthread sigaction(2) wrapper to
do its work for SIGINFO. Always install libpthread signal handler
wrapper for SIGINFO even if user SIG_IGN's or SIG_DFL's it.
SIGINFO has a special meaning for libpthread: when LIBPTHREAD_DEBUG
enviroment variable defined it is used for dumping an information
about threads to /tmp/.
Reported by: mi
Reviewed by: deischen
MFC after: 2 weeks
Diffstat (limited to 'lib/libpthread/thread/thr_sigaction.c')
-rw-r--r-- | lib/libpthread/thread/thr_sigaction.c | 12 |
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; |