smokey: y2038: Fix up error codes
PATCH v2 1/1 smokey: y2038: Fix up error codes
From: Jan Kiszka <[email protected]>
clock_gettime is returning the error in errno, and pthread_mutex_unlock is using positive error codes. The caller expects -errno.
Fixes 037495e487b5 ("y2038: testsuite/smokey/y2038: Adding test cases for mutex_timedlock64()")
Signed-off-by Jan Kiszka <[email protected]>
---
Changes in v2:
- fix typo in subject
- add fixes
testsuite/smokey/y2038/syscall-tests.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
testsuite/smokey/y2038/syscall-tests.c +3 -3
@@ -429,7 +429,7 @@ static void *timedlock64_thread(void *arg)int ret;if (ctx->timedwait_timecheck) { -if (!__T (ret,clock_gettime (CLOCK_REALTIME , &ts_nat))) +if (!__Terrno (ret,clock_gettime (CLOCK_REALTIME , &ts_nat)))return (void *)(long )ret; t1.tv_sec = ts_nat.tv_sec;
@@ -443,7 +443,7 @@ static void *timedlock64_thread(void *arg)return (void *)(long )ret;if (ctx->timedwait_timecheck) { -if (!__T (ret,clock_gettime (CLOCK_REALTIME , &ts_nat))) +if (!__Terrno (ret,clock_gettime (CLOCK_REALTIME , &ts_nat)))return (void *)(long )ret; t2.tv_sec = ts_nat.tv_sec;
@@ -457,7 +457,7 @@ static void *timedlock64_thread(void *arg) t2.tv_nsec); } -return (void *)(long )pthread_mutex_unlock (ctx->mutex); +return (void *)(long )-pthread_mutex_unlock (ctx->mutex); }static int test_sc_cobalt_mutex_timedlock64 (void )
Signature · 1 line
2.47.3