[ctime] 避免时区为负数时引入的隐式转换问题
This commit is contained in:
parent
ba0cb59797
commit
810da67b6f
|
@ -475,9 +475,9 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||||
{
|
{
|
||||||
tz->tz_dsttime = DST_NONE;
|
tz->tz_dsttime = DST_NONE;
|
||||||
#if defined(RT_LIBC_USING_LIGHT_TZ_DST)
|
#if defined(RT_LIBC_USING_LIGHT_TZ_DST)
|
||||||
tz->tz_minuteswest = -(rt_tz_get() / 60U);
|
tz->tz_minuteswest = -(rt_tz_get() / 60);
|
||||||
#else
|
#else
|
||||||
tz->tz_minuteswest = 0U;
|
tz->tz_minuteswest = 0;
|
||||||
#endif /* RT_LIBC_USING_LIGHT_TZ_DST */
|
#endif /* RT_LIBC_USING_LIGHT_TZ_DST */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue