It is incorrect to call setitimer(which, NULL, NULL) to disarm a timer,
Linux just gives a pass on that; properly provide a zeroed-out
structure instead.
Fixes: 760929f6ba18 "crypto/sleep.c: avoid returning early due to signal"
Reported-by: Neil Horman <nhorman@openssl.org>
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28215)
(cherry picked from commit
1b1a859d3d8aafbdda2977f9955ceee6f32f7ea4)
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
/* disarm the timer */
do {
- if (setitimer(ITIMER_REAL, NULL, NULL)) {
+ static const struct itimerval it;
+
+ if (setitimer(ITIMER_REAL, &it, NULL)) {
TEST_perror("test_sanity_sleep: disarm setitimer");
break;
}