summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_attr_setscope.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_attr_setscope.c')
-rw-r--r--lib/libpthread/thread/thr_attr_setscope.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_attr_setscope.c b/lib/libpthread/thread/thr_attr_setscope.c
index 70dd69e..dcf179e 100644
--- a/lib/libpthread/thread/thr_attr_setscope.c
+++ b/lib/libpthread/thread/thr_attr_setscope.c
@@ -48,8 +48,10 @@ _pthread_attr_setscope(pthread_attr_t *attr, int contentionscope)
} else if ((contentionscope != PTHREAD_SCOPE_PROCESS) &&
(contentionscope != PTHREAD_SCOPE_SYSTEM)) {
ret = EINVAL;
- } else
+ } else if (contentionscope == PTHREAD_SCOPE_SYSTEM) {
(*attr)->flags |= contentionscope;
-
+ } else {
+ (*attr)->flags &= ~PTHREAD_SCOPE_SYSTEM;
+ }
return (ret);
}
OpenPOWER on IntegriCloud