summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_sig.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-05-29 17:10:45 +0000
committerdeischen <deischen@FreeBSD.org>2003-05-29 17:10:45 +0000
commitcccb8a341841afbb6950f77adfed8b5bf81138ae (patch)
treedd986910f07eda0fc0f920fe954d097068627fef /lib/libpthread/thread/thr_sig.c
parent48c0de19de35c62a5516be4fe25f5dcf738dd5db (diff)
downloadFreeBSD-src-cccb8a341841afbb6950f77adfed8b5bf81138ae.zip
FreeBSD-src-cccb8a341841afbb6950f77adfed8b5bf81138ae.tar.gz
Don't really spin on a spinlock; silently convert it to the same
low-level lock used by the libpthread implementation. In the future, we'll eliminate spinlocks from libc but that will wait until after 5.1-release. Don't call an application signal handler if the handler is the same as the library-installed handler. This seems to be possible after a fork and is the cause of konsole hangs. Approved by: re@ (jhb)
Diffstat (limited to 'lib/libpthread/thread/thr_sig.c')
-rw-r--r--lib/libpthread/thread/thr_sig.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index da5b0b6..49a1c39 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -175,7 +175,7 @@ _thr_sig_dispatch(struct kse *curkse, int sig, siginfo_t *info)
void
_thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp)
{
- void (*sigfunc)(int, siginfo_t *, void *);
+ __siginfohandler_t *sigfunc;
struct kse *curkse;
curkse = _get_curkse();
@@ -184,7 +184,8 @@ _thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp)
sigfunc = _thread_sigact[sig - 1].sa_sigaction;
ucp->uc_sigmask = _thr_proc_sigmask;
if (((__sighandler_t *)sigfunc != SIG_DFL) &&
- ((__sighandler_t *)sigfunc != SIG_IGN)) {
+ ((__sighandler_t *)sigfunc != SIG_IGN) &&
+ (sigfunc != (__siginfohandler_t *)_thr_sig_handler)) {
if (((_thread_sigact[sig - 1].sa_flags & SA_SIGINFO)
!= 0) || (info == NULL))
(*(sigfunc))(sig, info, ucp);
OpenPOWER on IntegriCloud