diff options
Diffstat (limited to 'sysdeps/htl/pt-rwlock-timedwrlock.c')
-rw-r--r-- | sysdeps/htl/pt-rwlock-timedwrlock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/htl/pt-rwlock-timedwrlock.c b/sysdeps/htl/pt-rwlock-timedwrlock.c index 4452dd9af4..2316321d79 100644 --- a/sysdeps/htl/pt-rwlock-timedwrlock.c +++ b/sysdeps/htl/pt-rwlock-timedwrlock.c @@ -1,5 +1,5 @@ /* Acquire a rwlock for writing. Generic version. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,10 +14,11 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <pthread.h> #include <assert.h> +#include <time.h> #include <pt-internal.h> @@ -46,7 +47,7 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, /* The lock is busy. */ - if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) + if (abstime != NULL && ! valid_nanoseconds (abstime->tv_nsec)) return EINVAL; self = _pthread_self (); |