mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-18 01:14:06 +00:00
Change clock source to boottime on linux.
CLOCK_MONOTONIC does not account for time when suspend. And CLOCK_BOOTTIME does it. Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
3c3b94a31b
commit
5cc39a6a9d
@ -235,7 +235,11 @@ mbedtls_ms_time_t mbedtls_ms_time(void)
|
||||
struct timespec tv;
|
||||
mbedtls_ms_time_t current_ms;
|
||||
|
||||
#if defined(__linux__)
|
||||
ret = clock_gettime(CLOCK_BOOTTIME, &tv);
|
||||
#else
|
||||
ret = clock_gettime(CLOCK_MONOTONIC, &tv);
|
||||
#endif
|
||||
if (ret) {
|
||||
return time(NULL) * 1000;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user