Fix sys_utc_to_localtime+

This commit is contained in:
Ivan Chikish 2023-07-23 17:37:28 +03:00
parent 3e10dac4dc
commit 0e1217d131

View File

@ -1031,11 +1031,10 @@ orbis::SysResult orbis::sys_utc_to_localtime(Thread *thread, int64_t time,
int64_t *localtime,
orbis::timesec *_sec,
int *_dst_sec) {
// Disabled for now
thread->retval[0] = (int)ErrorCode::RANGE;
return {};
ORBIS_LOG_TRACE(__FUNCTION__, time, localtime, _sec, _dst_sec);
// Disabled for now
return SysResult::notAnError(ErrorCode::RANGE);
struct ::tm tp;
auto result = ::mktime(::localtime_r(&time, &tp));
if (auto e = uwrite(localtime, result); e != ErrorCode{})
@ -1048,11 +1047,10 @@ orbis::SysResult orbis::sys_localtime_to_utc(Thread *thread, int64_t time,
uint unk, int64_t *ptime,
orbis::timesec *_sec,
int *_dst_sec) {
// Disabled for now
thread->retval[0] = (int)ErrorCode::RANGE;
return {};
ORBIS_LOG_TRACE(__FUNCTION__, time, unk, ptime, _sec, _dst_sec);
// Disabled for now
return SysResult::notAnError(ErrorCode::RANGE);
struct ::tm tp;
::time_t timez = 0;
auto result = time - ::mktime(::localtime_r(&timez, &tp));