mirror of
https://github.com/apache/nuttx.git
synced 2026-10-19 20:58:54 +00:00
Replace mktime with timegm in rtc and fs driver
since kernel component should use UTC instead local time Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Icf939e1ab0af8e577105f539d2553bc67b3b3d10
This commit is contained in:
parent
fed064f45e
commit
800754a9be
19 changed files with 38 additions and 38 deletions
|
|
@ -83,7 +83,7 @@ static int sim_rtc_rdtime(FAR struct rtc_lowerhalf_s *lower,
|
|||
static int sim_rtc_settime(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct rtc_time *rtctime)
|
||||
{
|
||||
g_sim_delta = mktime((FAR struct tm *)rtctime);
|
||||
g_sim_delta = timegm((FAR struct tm *)rtctime);
|
||||
g_sim_delta *= NSEC_PER_SEC;
|
||||
g_sim_delta += rtctime->tm_nsec;
|
||||
g_sim_delta -= host_gettime(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue