diff options
author | deischen <deischen@FreeBSD.org> | 2003-05-30 00:09:22 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-05-30 00:09:22 +0000 |
commit | 51dd2dd2b3fe2cc5a81d2a41ffc4166698a4b22f (patch) | |
tree | 1493ec223b654c43a7dbf8a2d46dac73c56fff26 | |
parent | 52d5c0b256b0a78a802032002daf4ca6dac3216f (diff) | |
download | FreeBSD-src-51dd2dd2b3fe2cc5a81d2a41ffc4166698a4b22f.zip FreeBSD-src-51dd2dd2b3fe2cc5a81d2a41ffc4166698a4b22f.tar.gz |
Call the __sys_sigprocmask(the system call) when sigprocmask()
is called and the application is not threaded. This works around
a problem when an application that hasn't yet become threaded
tries to jump out of a signal handler.
Reported by: mbr
Approved by: re@ (rwatson)
-rw-r--r-- | lib/libkse/thread/thr_sigprocmask.c | 5 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_sigprocmask.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_sigprocmask.c b/lib/libkse/thread/thr_sigprocmask.c index a56e63e..ec39da0 100644 --- a/lib/libkse/thread/thr_sigprocmask.c +++ b/lib/libkse/thread/thr_sigprocmask.c @@ -44,5 +44,8 @@ __weak_reference(_sigprocmask, sigprocmask); int _sigprocmask(int how, const sigset_t *set, sigset_t *oset) { - return (pthread_sigmask(how, set, oset)); + if (_kse_isthreaded() != 0) + return (pthread_sigmask(how, set, oset)); + else + return (__sys_sigprocmask(how, set, oset)); } diff --git a/lib/libpthread/thread/thr_sigprocmask.c b/lib/libpthread/thread/thr_sigprocmask.c index a56e63e..ec39da0 100644 --- a/lib/libpthread/thread/thr_sigprocmask.c +++ b/lib/libpthread/thread/thr_sigprocmask.c @@ -44,5 +44,8 @@ __weak_reference(_sigprocmask, sigprocmask); int _sigprocmask(int how, const sigset_t *set, sigset_t *oset) { - return (pthread_sigmask(how, set, oset)); + if (_kse_isthreaded() != 0) + return (pthread_sigmask(how, set, oset)); + else + return (__sys_sigprocmask(how, set, oset)); } |