From 4c6962436ae8a89252c397dffac4b865f5cb663f Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 7 Feb 2021 22:33:37 +0800 Subject: [PATCH] update --- components/libc/compilers/common/time.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index d7f239bea..bdbb27bce 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -213,10 +213,9 @@ RT_WEAK clock_t clock(void) /* TODO: timezone */ int gettimeofday(struct timeval *tp, struct timezone *tz) { - time_t t = time(RT_NULL); if (tp != RT_NULL) { - tp->tv_sec = t; + tp->tv_sec = time(RT_NULL); tp->tv_usec = 0; } return 0; -- GitLab