From 5604830dea207bbd5fd5dbe087cc7ca30b527bb5 Mon Sep 17 00:00:00 2001 From: Stafford Horne Date: Thu, 19 Aug 2021 23:47:07 +0900 Subject: time: Fix compile error in itimer test affecting hurd The recent change to use __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 to avoid doing 64-bit checks on some platforms broke the test for hurd where __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 is not defined. With error: tst-itimer.c: In function 'do_test': tst-itimer.c:103:11: error: '__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64' undeclared (first use in this function) 103 | if (__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tst-itimer.c:103:11: note: each undeclared identifier is reported only once for each function it appears in Define a support helper to detect when setitimer and getitimer support 64-bit time_t. Fixes commit 6e8a0aac2f ("time: Fix overflow itimer tests on 32-bit systems"). Cc: Adhemerval Zanella Cc: Joseph Myers --- time/tst-itimer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'time') diff --git a/time/tst-itimer.c b/time/tst-itimer.c index bd7d7afe83..c6d623cb19 100644 --- a/time/tst-itimer.c +++ b/time/tst-itimer.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -100,7 +101,7 @@ do_test (void) /* Linux does not provide 64 bit time_t support for getitimer and setitimer on architectures with 32 bit time_t support. */ - if (__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64) + if (support_itimer_support_time64()) { TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, @@ -131,7 +132,7 @@ do_test (void) it.it_interval.tv_usec = 20; it.it_value.tv_sec = 30; it.it_value.tv_usec = 40; - if (__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64) + if (support_itimer_support_time64()) { TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); -- cgit 1.4.1