Explorar o código

[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 %!s(int64=2) %!d(string=hai) anos
pai
achega
517b5eb016
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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;