From 501280b6e5043ce6a2d1ab0c2f8918ca5786b05c Mon Sep 17 00:00:00 2001 From: Aurora Wright Date: Tue, 4 Aug 2020 04:25:59 +0200 Subject: [PATCH] fatal: Fix autoreboot logic --- stratosphere/fatal/source/fatal_config.hpp | 4 ++-- stratosphere/fatal/source/fatal_task_power.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stratosphere/fatal/source/fatal_config.hpp b/stratosphere/fatal/source/fatal_config.hpp index b34e79525..38f2c0785 100644 --- a/stratosphere/fatal/source/fatal_config.hpp +++ b/stratosphere/fatal/source/fatal_config.hpp @@ -68,11 +68,11 @@ namespace ams::fatal::srv { } u64 GetQuestRebootTimeoutInterval() const { - return this->quest_reboot_interval_second * 1'000'000'000ul; + return this->quest_reboot_interval_second * 1'000ul; } u64 GetFatalRebootTimeoutInterval() const { - return this->fatal_auto_reboot_interval * 1'000'000ul; + return this->fatal_auto_reboot_interval; } const char *GetErrorMessage() const { diff --git a/stratosphere/fatal/source/fatal_task_power.cpp b/stratosphere/fatal/source/fatal_task_power.cpp index 69d84ef46..7c2a082b5 100644 --- a/stratosphere/fatal/source/fatal_task_power.cpp +++ b/stratosphere/fatal/source/fatal_task_power.cpp @@ -55,15 +55,15 @@ namespace ams::fatal::srv { private: os::Tick start_tick; bool flag; - s32 interval; + s64 interval; public: - RebootTimingObserver(bool flag, s32 interval) : start_tick(os::GetSystemTick()), flag(flag), interval(interval) { + RebootTimingObserver(bool flag, s64 interval) : start_tick(os::GetSystemTick()), flag(flag), interval(interval) { /* ... */ } bool IsRebootTiming() const { auto current_tick = os::GetSystemTick(); - return this->flag && (current_tick - this->start_tick).ToTimeSpan().GetSeconds() >= this->interval; + return this->flag && (current_tick - this->start_tick).ToTimeSpan().GetMilliSeconds() >= this->interval; } };