[orbis-kernel] Fix sys_localtime_to_utc

This commit is contained in:
Ivan Chikish 2023-07-14 21:23:23 +03:00
parent 0d7f50a246
commit 1d4b96b3de

View File

@ -872,7 +872,8 @@ orbis::SysResult orbis::sys_localtime_to_utc(Thread *thread, int64_t time,
int *_dst_sec) {
ORBIS_LOG_TRACE(__FUNCTION__, time, unk, ptime, _sec, _dst_sec);
struct ::tm tp;
auto result = ::mktime(::gmtime_r(&time, &tp));
::time_t timez = 0;
auto result = time - ::mktime(::localtime_r(&timez, &tp));
if (auto e = uwrite(ptime, result); e != ErrorCode{})
return e;
uwrite(_sec, {});