Browse Source

[libc][ctime] stime clear tv.tv_usec as zero
when using stime set rtc time, tv.tv_usec not 0,but always is 0xdeadbeef, make set time error

Lei Peng 2 năm trước cách đây
mục cha
commit
517b5eb016
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      components/libc/compilers/common/ctime.c

+ 1 - 0
components/libc/compilers/common/ctime.c

@@ -383,6 +383,7 @@ int stime(const time_t *t)
     }
 
     tv.tv_sec = *t;
+    tv.tv_usec = 0;
     if (set_timeval(&tv) == RT_EOK)
     {
         return 0;