Return seconds when clock_gettime error

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-02-23 11:25:36 +08:00
parent 05bc87866e
commit 029e659bbb

View File

@ -183,7 +183,7 @@ mbedtls_ms_time_t mbedtls_ms_time(void)
ret = clock_gettime(CLOCK_REALTIME, &tv); ret = clock_gettime(CLOCK_REALTIME, &tv);
if (ret) { if (ret) {
return 0; return time(NULL) * 1000;
} }
current_ms = tv.tv_sec; current_ms = tv.tv_sec;