diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-08-15 05:53:50 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-08-15 05:53:50 +0000 |
commit | 3a2ba84afba2d9b315c65aa46ba036fd22ef4fb0 (patch) | |
tree | 47a553a26365a6738426804af7609434daf047b8 /nptl/pthread_mutex_getprioceiling.c | |
parent | 256926546643ba909661c83e7a7d24d733b9b390 (diff) | |
download | glibc-3a2ba84afba2d9b315c65aa46ba036fd22ef4fb0.tar glibc-3a2ba84afba2d9b315c65aa46ba036fd22ef4fb0.tar.gz glibc-3a2ba84afba2d9b315c65aa46ba036fd22ef4fb0.tar.bz2 glibc-3a2ba84afba2d9b315c65aa46ba036fd22ef4fb0.zip |
Updated to fedora-glibc-20060815T0533
Diffstat (limited to 'nptl/pthread_mutex_getprioceiling.c')
-rw-r--r-- | nptl/pthread_mutex_getprioceiling.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nptl/pthread_mutex_getprioceiling.c b/nptl/pthread_mutex_getprioceiling.c index 4d1bc28431..1ce5eaebef 100644 --- a/nptl/pthread_mutex_getprioceiling.c +++ b/nptl/pthread_mutex_getprioceiling.c @@ -18,6 +18,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <errno.h> #include <pthreadP.h> @@ -26,7 +27,11 @@ pthread_mutex_getprioceiling (mutex, prioceiling) const pthread_mutex_t *mutex; int *prioceiling; { - *prioceiling = (mutex->__data.__kind & PTHREAD_MUTEX_PRIO_CEILING_MASK) + if (__builtin_expect ((mutex->__data.__kind + & PTHREAD_MUTEX_PRIO_PROTECT_NP) == 0, 0)) + return EINVAL; + + *prioceiling = (mutex->__data.__lock & PTHREAD_MUTEX_PRIO_CEILING_MASK) >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT; return 0; |