aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread_sigmask.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-12 06:06:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-02-12 06:06:22 +0000
commit6f94de3ca49e4ea147b1c59e5818fa175846518f (patch)
tree9a2c45004114f53c4cf1f9468a58fe54c58320fa /libc/bionic/pthread_sigmask.cpp
parent2a1bb4e64677b9abbc17173c79768ed494565047 (diff)
downloadandroid_bionic-6f94de3ca49e4ea147b1c59e5818fa175846518f.tar.gz
android_bionic-6f94de3ca49e4ea147b1c59e5818fa175846518f.tar.bz2
android_bionic-6f94de3ca49e4ea147b1c59e5818fa175846518f.zip
Revert "More pthreads cleanup."
This reverts commit 2a1bb4e64677b9abbc17173c79768ed494565047 Change-Id: Ia443d0748015c8e9fc3121e40e68258616767b51
Diffstat (limited to 'libc/bionic/pthread_sigmask.cpp')
-rw-r--r--libc/bionic/pthread_sigmask.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/libc/bionic/pthread_sigmask.cpp b/libc/bionic/pthread_sigmask.cpp
index e4e1b2b98..9c9dc3ed8 100644
--- a/libc/bionic/pthread_sigmask.cpp
+++ b/libc/bionic/pthread_sigmask.cpp
@@ -30,13 +30,12 @@
#include <pthread.h>
#include <signal.h>
-#include "private/ErrnoRestorer.h"
-#include "private/kernel_sigset_t.h"
+#include <private/kernel_sigset_t.h>
extern "C" int __rt_sigprocmask(int, const kernel_sigset_t*, kernel_sigset_t*, size_t);
int pthread_sigmask(int how, const sigset_t* iset, sigset_t* oset) {
- ErrnoRestorer errno_restorer;
+ int old_errno = errno;
// 'in_set_ptr' is the second parameter to __rt_sigprocmask. It must be NULL
// if 'set' is NULL to ensure correct semantics (which in this case would
@@ -49,13 +48,15 @@ int pthread_sigmask(int how, const sigset_t* iset, sigset_t* oset) {
}
kernel_sigset_t out_set;
- if (__rt_sigprocmask(how, in_set_ptr, &out_set, sizeof(out_set)) == -1) {
- return errno;
+ int result = __rt_sigprocmask(how, in_set_ptr, &out_set, sizeof(out_set));
+ if (result < 0) {
+ result = errno;
}
if (oset != NULL) {
*oset = out_set.bionic;
}
- return 0;
+ errno = old_errno;
+ return result;
}