summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-02-07 22:33:37 +0800
committerMeco Man <[email protected]>2021-02-07 22:33:37 +0800
commit4c6962436ae8a89252c397dffac4b865f5cb663f (patch)
tree1c593fd9ed9f2da00d76ad5c831313dbd470a5d7 /components
parentd92f8a53da900f4c03dd8c5c0b8163a03a72a9df (diff)
update
Diffstat (limited to 'components')
-rw-r--r--components/libc/compilers/common/time.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c
index d7f239bea1..bdbb27bce4 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;