From 0e1217d131296903d02d15bd389899cfe981fd24 Mon Sep 17 00:00:00 2001 From: Ivan Chikish Date: Sun, 23 Jul 2023 17:37:28 +0300 Subject: [PATCH] Fix sys_utc_to_localtime+ --- orbis-kernel/src/sys/sys_sce.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/orbis-kernel/src/sys/sys_sce.cpp b/orbis-kernel/src/sys/sys_sce.cpp index e07b844e5..96fb60198 100644 --- a/orbis-kernel/src/sys/sys_sce.cpp +++ b/orbis-kernel/src/sys/sys_sce.cpp @@ -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));