aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c3
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
index 2cba0d3c88..85cc176a9a 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
@@ -70,7 +70,8 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
performed if we would not block at all simply moving the test
to the front is no option. Replicating all the code is
costly while this test is not. */
- if (__builtin_expect (abstime->tv_nsec >= 1000000000, 0))
+ if (__builtin_expect (abstime->tv_nsec >= 1000000000
+ || abstime->tv_sec < 0, 0))
{
result = EINVAL;
break;
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
index a3cdda30bb..dd5f9b4ccf 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
@@ -61,7 +61,8 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
performed if we would not block at all simply moving the test
to the front is no option. Replicating all the code is
costly while this test is not. */
- if (abstime->tv_nsec >= 1000000000)
+ if (__builtin_expect (abstime->tv_nsec >= 1000000000
+ || abstime->tv_sec < 0, 0))
{
result = EINVAL;
break;