Skip to content

Commit 517b5eb

Browse files
kkkkkachemysterywolf
authored andcommitted
[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
1 parent ba6a27c commit 517b5eb

File tree

1 file changed

+1
-0
lines changed
  • components/libc/compilers/common

1 file changed

+1
-0
lines changed

components/libc/compilers/common/ctime.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ int stime(const time_t *t)
383383
}
384384

385385
tv.tv_sec = *t;
386+
tv.tv_usec = 0;
386387
if (set_timeval(&tv) == RT_EOK)
387388
{
388389
return 0;

0 commit comments

Comments
 (0)