From: Larkin Nickle Date: Wed, 2 Jun 2021 18:17:40 +0000 (-0400) Subject: Fix compilation on systems with empty _POSIX_TIMERS X-Git-Tag: openssl-3.0.0-beta1~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=907720f0644bf6b7ad4fa94f03ac29402ae597ab;p=thirdparty%2Fopenssl.git 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) --- 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)