From 907720f0644bf6b7ad4fa94f03ac29402ae597ab Mon Sep 17 00:00:00 2001 From: Larkin Nickle Date: Wed, 2 Jun 2021 14:17:40 -0400 Subject: [PATCH] Fix compilation on systems with empty _POSIX_TIMERS Systems such as Tru64 ship with broken headers that have _POSIX_TIMERS defined but empty. CLA: trivial Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15598) --- providers/implementations/rands/seeding/rand_unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c index f77f6e0324a..2e6429344c7 100644 --- a/providers/implementations/rands/seeding/rand_unix.c +++ b/providers/implementations/rands/seeding/rand_unix.c @@ -76,7 +76,9 @@ static uint64_t get_timer_bits(void); * macro that might be undefined. */ # undef OSSL_POSIX_TIMER_OKAY -# if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 +/* On some systems, _POSIX_TIMERS is defined but empty. + * Subtracting by 0 when comparing avoids an error in this case. */ +# if defined(_POSIX_TIMERS) && _POSIX_TIMERS -0 > 0 # if defined(__GLIBC__) # if defined(__GLIBC_PREREQ) # if __GLIBC_PREREQ(2, 17) -- 2.47.2