From 43dd76d2428f29c23526d500d7e28d7dfce6fa49 Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Fri, 30 May 2003 00:09:22 +0000 Subject: [PATCH] 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) --- lib/libkse/thread/thr_sigprocmask.c | 5 ++++- 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 a56e63eb2af..ec39da009a8 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 a56e63eb2af..ec39da009a8 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)); }