mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
wolfcrypt/src/wc_port.c LINUXKM time(): use ktime_get_coarse_real_ts64 instead of ktime_get_real_seconds, to avoid GPL-only function, and fix the calculation in the kernel 3.x codepath.
This commit is contained in:
@ -2438,9 +2438,11 @@ time_t time(time_t * timer)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
|
||||
struct timespec ts;
|
||||
getnstimeofday(&ts);
|
||||
ret = ts.tv_sec * 1000000000LL + ts.tv_nsec;
|
||||
ret = ts.tv_sec;
|
||||
#else
|
||||
ret = ktime_get_real_seconds();
|
||||
struct timespec64 ts;
|
||||
ktime_get_coarse_real_ts64(&ts);
|
||||
ret = ts.tv_sec;
|
||||
#endif
|
||||
if (timer)
|
||||
*timer = ret;
|
||||
|
Reference in New Issue
Block a user