[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
This commit is contained in:
Lei Peng 2023-03-29 11:02:45 +08:00 committed by Man, Jianting (Meco)
parent ba6a27c850
commit 517b5eb016
1 changed files with 1 additions and 0 deletions

View File

@ -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;