Index: nptl/pthread_condattr_setpshared.c |
diff --git a/nptl/pthread_condattr_setpshared.c b/nptl/pthread_condattr_setpshared.c |
index f00858780b93028b8bc27ac2965cbda7edaf6f9f..f1813da7f10feb2715a729693546c6f4d8309028 100644 |
--- a/nptl/pthread_condattr_setpshared.c |
+++ b/nptl/pthread_condattr_setpshared.c |
@@ -20,18 +20,21 @@ |
#include <errno.h> |
#include <pthreadP.h> |
+ |
int |
pthread_condattr_setpshared (attr, pshared) |
pthread_condattr_t *attr; |
int pshared; |
{ |
- if (pshared != PTHREAD_PROCESS_PRIVATE |
- && __builtin_expect (pshared != PTHREAD_PROCESS_SHARED, 0)) |
- return EINVAL; |
- |
- int *valuep = &((struct pthread_condattr *) attr)->value; |
+ switch (pshared) |
+ { |
+ case PTHREAD_PROCESS_PRIVATE: /* This is the default state. */ |
+ return 0; |
- *valuep = (*valuep & ~1) | (pshared != PTHREAD_PROCESS_PRIVATE); |
+ case PTHREAD_PROCESS_SHARED: /* NaCl does not support this. */ |
+ return ENOTSUP; |
- return 0; |
+ default: /* Anything else is bogus. */ |
+ return EINVAL; |
+ } |
} |