From fc493bc9e6fe8ecdd00f79b9a8a3d4675137a602 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 1 Dec 2018 21:39:30 +0100 Subject: htl: Fix comparing attr with default values Fortunately we were previously only missing an optimization. Thanks dcb for the report [BZ #23032] * sysdeps/htl/pt-barrier-init.c (pthread_barrier_init): Fix comparing attr with __pthread_default_barrierattr. * sysdeps/htl/pt-cond-init.c (__pthread_cond_init): Fix comparing attr with __pthread_default_condattr. * sysdeps/htl/pt-mutex-init.c (_pthread_mutex_init): Fix comparing attr with __pthread_default_mutexattr. * sysdeps/htl/pt-rwlock-init.c (_pthread_rwlock_init): Fix comparing attr with __pthread_default_rwlockattr. --- sysdeps/htl/pt-barrier-init.c | 2 +- sysdeps/htl/pt-cond-init.c | 2 +- sysdeps/htl/pt-mutex-init.c | 2 +- sysdeps/htl/pt-rwlock-init.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sysdeps/htl') diff --git a/sysdeps/htl/pt-barrier-init.c b/sysdeps/htl/pt-barrier-init.c index 7d46624fbe..f94dcca3dc 100644 --- a/sysdeps/htl/pt-barrier-init.c +++ b/sysdeps/htl/pt-barrier-init.c @@ -36,7 +36,7 @@ pthread_barrier_init (pthread_barrier_t *barrier, barrier->__count = count; if (attr == NULL - || memcmp (attr, &__pthread_default_barrierattr, sizeof (*attr) == 0)) + || memcmp (attr, &__pthread_default_barrierattr, sizeof (*attr)) == 0) /* Use the default attributes. */ return 0; diff --git a/sysdeps/htl/pt-cond-init.c b/sysdeps/htl/pt-cond-init.c index 4c112e2789..4ae8859b82 100644 --- a/sysdeps/htl/pt-cond-init.c +++ b/sysdeps/htl/pt-cond-init.c @@ -28,7 +28,7 @@ __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t * attr) *cond = (pthread_cond_t) __PTHREAD_COND_INITIALIZER; if (attr == NULL - || memcmp (attr, &__pthread_default_condattr, sizeof (*attr) == 0)) + || memcmp (attr, &__pthread_default_condattr, sizeof (*attr)) == 0) /* Use the default attributes. */ return 0; diff --git a/sysdeps/htl/pt-mutex-init.c b/sysdeps/htl/pt-mutex-init.c index 664fd607c1..813b976e62 100644 --- a/sysdeps/htl/pt-mutex-init.c +++ b/sysdeps/htl/pt-mutex-init.c @@ -29,7 +29,7 @@ _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) *mutex = (pthread_mutex_t) __PTHREAD_MUTEX_INITIALIZER; if (attr == NULL - || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr) == 0)) + || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr)) == 0) /* The default attributes. */ return 0; diff --git a/sysdeps/htl/pt-rwlock-init.c b/sysdeps/htl/pt-rwlock-init.c index 527b0ec62f..41d6df5d38 100644 --- a/sysdeps/htl/pt-rwlock-init.c +++ b/sysdeps/htl/pt-rwlock-init.c @@ -27,7 +27,7 @@ _pthread_rwlock_init (pthread_rwlock_t *rwlock, *rwlock = (pthread_rwlock_t) __PTHREAD_RWLOCK_INITIALIZER; if (attr == NULL - || memcmp (attr, &__pthread_default_rwlockattr, sizeof (*attr) == 0)) + || memcmp (attr, &__pthread_default_rwlockattr, sizeof (*attr)) == 0) /* Use the default attributes. */ return 0; -- cgit 1.4.1