From cd0a0c267b4c9b92396f91b9a2fb67c89be00030 Mon Sep 17 00:00:00 2001 From: David Xu Date: Wed, 4 Jun 2003 12:38:21 +0000 Subject: [PATCH] Despite whether threaded mode is turned on, always save thread's signal mask. --- lib/libkse/thread/thr_sigprocmask.c | 10 ++++++---- lib/libpthread/thread/thr_sigprocmask.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/libkse/thread/thr_sigprocmask.c b/lib/libkse/thread/thr_sigprocmask.c index ec39da009a82..9cb493a8c612 100644 --- a/lib/libkse/thread/thr_sigprocmask.c +++ b/lib/libkse/thread/thr_sigprocmask.c @@ -44,8 +44,10 @@ __weak_reference(_sigprocmask, sigprocmask); int _sigprocmask(int how, const sigset_t *set, sigset_t *oset) { - if (_kse_isthreaded() != 0) - return (pthread_sigmask(how, set, oset)); - else - return (__sys_sigprocmask(how, set, oset)); + int ret; + + ret = pthread_sigmask(how, set, oset); + if ((ret == 0) && (_kse_isthreaded() == 0)) + ret = __sys_sigprocmask(how, set, oset); + return (ret); } diff --git a/lib/libpthread/thread/thr_sigprocmask.c b/lib/libpthread/thread/thr_sigprocmask.c index ec39da009a82..9cb493a8c612 100644 --- a/lib/libpthread/thread/thr_sigprocmask.c +++ b/lib/libpthread/thread/thr_sigprocmask.c @@ -44,8 +44,10 @@ __weak_reference(_sigprocmask, sigprocmask); int _sigprocmask(int how, const sigset_t *set, sigset_t *oset) { - if (_kse_isthreaded() != 0) - return (pthread_sigmask(how, set, oset)); - else - return (__sys_sigprocmask(how, set, oset)); + int ret; + + ret = pthread_sigmask(how, set, oset); + if ((ret == 0) && (_kse_isthreaded() == 0)) + ret = __sys_sigprocmask(how, set, oset); + return (ret); }