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:
Xiang Xiao 2021-06-22 00:44:48 +08:00 • committed by xiaoxiang
parent fed064f45e
commit 800754a9be
19 changed files with 38 additions and 38 deletions

View file

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