From c89fe574493f438dd0e94bb9a89227e4ca84c0b7 Mon Sep 17 00:00:00 2001 From: "Randall S. Becker" Date: Sat, 30 Mar 2024 22:28:02 +0000 Subject: NonStop: Do not call sleep() with a 0 value This change ensures that sleep(0) is not invoked to cause unexpected duplicate thread context switches when _REENTRANT is specified. Fixes: #24009 Signed-off-by: Randall S. Becker Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24012) --- crypto/sleep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crypto') diff --git a/crypto/sleep.c b/crypto/sleep.c index dc97d4edc0..73467fb859 100644 --- a/crypto/sleep.c +++ b/crypto/sleep.c @@ -31,7 +31,8 @@ void OSSL_sleep(uint64_t millis) unsigned int s = (unsigned int)(millis / 1000); unsigned int us = (unsigned int)((millis % 1000) * 1000); - sleep(s); + if (s > 0) + sleep(s); usleep(us); # endif } -- cgit v1.2.3