summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc_r/uthread/uthread_sig.c12
-rw-r--r--lib/libpthread/uthread/uthread_sig.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c
index fd49684c955..48f360f3ea3 100644
--- a/lib/libc_r/uthread/uthread_sig.c
+++ b/lib/libc_r/uthread/uthread_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_sig.c,v 1.12 2001/12/31 18:23:15 fgsch Exp $ */
+/* $OpenBSD: uthread_sig.c,v 1.13 2002/10/07 22:36:04 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -378,6 +378,7 @@ void
_dispatch_signals()
{
struct pthread *curthread = _get_curthread();
+ void (*action)(int, siginfo_t *, void *);
int i;
/*
@@ -395,14 +396,21 @@ _dispatch_signals()
_thread_sigact[i - 1].sa_handler != SIG_IGN &&
sigismember(&curthread->sigpend,i) &&
!sigismember(&curthread->sigmask,i)) {
+ action = _thread_sigact[i - 1].sa_sigaction;
+
/* Clear the pending signal: */
sigdelset(&curthread->sigpend,i);
+ /* clear custom handler if SA_RESETHAND set. */
+ if (_thread_sigact[i - 1].sa_flags &
+ SA_RESETHAND)
+ _thread_sigact[i - 1].sa_handler =
+ SIG_DFL;
/*
* Dispatch the signal via the custom signal
* handler:
*/
- (*(_thread_sigact[i - 1].sa_handler))(i);
+ (*action)(i, 0, 0);
}
}
#endif
diff --git a/lib/libpthread/uthread/uthread_sig.c b/lib/libpthread/uthread/uthread_sig.c
index fd49684c955..48f360f3ea3 100644
--- a/lib/libpthread/uthread/uthread_sig.c
+++ b/lib/libpthread/uthread/uthread_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_sig.c,v 1.12 2001/12/31 18:23:15 fgsch Exp $ */
+/* $OpenBSD: uthread_sig.c,v 1.13 2002/10/07 22:36:04 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -378,6 +378,7 @@ void
_dispatch_signals()
{
struct pthread *curthread = _get_curthread();
+ void (*action)(int, siginfo_t *, void *);
int i;
/*
@@ -395,14 +396,21 @@ _dispatch_signals()
_thread_sigact[i - 1].sa_handler != SIG_IGN &&
sigismember(&curthread->sigpend,i) &&
!sigismember(&curthread->sigmask,i)) {
+ action = _thread_sigact[i - 1].sa_sigaction;
+
/* Clear the pending signal: */
sigdelset(&curthread->sigpend,i);
+ /* clear custom handler if SA_RESETHAND set. */
+ if (_thread_sigact[i - 1].sa_flags &
+ SA_RESETHAND)
+ _thread_sigact[i - 1].sa_handler =
+ SIG_DFL;
/*
* Dispatch the signal via the custom signal
* handler:
*/
- (*(_thread_sigact[i - 1].sa_handler))(i);
+ (*action)(i, 0, 0);
}
}
#endif