From f2ff06c9d4bd0d47a455d0f9a1ac9571e11fe7de Mon Sep 17 00:00:00 2001 From: Jose Alamos <jose.alamos@haw-hamburg.de> Date: Tue, 21 Aug 2018 13:58:39 +0200 Subject: [PATCH] posix/pthread_rwlock: fix unsigned variable comparison --- sys/posix/pthread/pthread_rwlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/posix/pthread/pthread_rwlock.c b/sys/posix/pthread/pthread_rwlock.c index 3e5f719473..b644c91afd 100644 --- a/sys/posix/pthread/pthread_rwlock.c +++ b/sys/posix/pthread/pthread_rwlock.c @@ -191,7 +191,7 @@ static int pthread_rwlock_timedlock(pthread_rwlock_t *rwlock, uint64_t then = ((uint64_t)abstime->tv_sec * US_PER_SEC) + (abstime->tv_nsec / NS_PER_US); - if ((then - now) <= 0) { + if (now >= then) { return ETIMEDOUT; } else { -- GitLab