summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2002-10-07 22:36:04 +0000
committermarc <marc@openbsd.org>2002-10-07 22:36:04 +0000
commit8896b8b5f611e68fd860c7fa1f82b93bcb64af93 (patch)
tree0a0c5306ac5f78a0123cb3873bb31e81cdf86486 /lib/libpthread
parentuse/check SA_RESETHAND, too. (diff)
downloadwireguard-openbsd-8896b8b5f611e68fd860c7fa1f82b93bcb64af93.tar.xz
wireguard-openbsd-8896b8b5f611e68fd860c7fa1f82b93bcb64af93.zip
handle the SA_RESETHAND flag.
Part of the prep for SA_SIGINFO support. With this change the new siginfo regression test will fail instead of loop on all arches.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_sig.c12
1 files changed, 10 insertions, 2 deletions
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