mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 03:35:39 +01:00
Timing: fix set_alarm(0) on Unix/POSIX
The POSIX/Unix implementation of set_alarm did not set the alarmed flag when called with 0, which was inconsistent with what the documentation implied and with the Windows behavior.
This commit is contained in:
parent
605c2284bc
commit
de896ebd26
@ -43,6 +43,7 @@ Bugfix
|
|||||||
* Fix word size check in in pk.c to not depend on MBEDTLS_HAVE_INT64.
|
* Fix word size check in in pk.c to not depend on MBEDTLS_HAVE_INT64.
|
||||||
* Fix crash when calling mbedtls_ssl_cache_free() twice. Found by
|
* Fix crash when calling mbedtls_ssl_cache_free() twice. Found by
|
||||||
MilenkoMitrovic, #1104
|
MilenkoMitrovic, #1104
|
||||||
|
* Fix mbedtls_timing_alarm(0) on Unix.
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* Extend cert_write example program by options to set the CRT version
|
* Extend cert_write example program by options to set the CRT version
|
||||||
|
@ -318,6 +318,12 @@ void set_alarm( int seconds )
|
|||||||
alarmed = 0;
|
alarmed = 0;
|
||||||
signal( SIGALRM, sighandler );
|
signal( SIGALRM, sighandler );
|
||||||
alarm( seconds );
|
alarm( seconds );
|
||||||
|
if( seconds == 0 )
|
||||||
|
{
|
||||||
|
/* alarm(0) cancelled any previous pending alarm, but the
|
||||||
|
handler won't fire, so raise the flag straight away. */
|
||||||
|
alarmed = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void m_sleep( int milliseconds )
|
void m_sleep( int milliseconds )
|
||||||
|
Loading…
Reference in New Issue
Block a user