fatal: Fix autoreboot logic

This commit is contained in:
Aurora Wright 2020-08-04 04:25:59 +02:00 committed by SciresM
parent ee5a095c1a
commit 501280b6e5
2 changed files with 5 additions and 5 deletions

View file

@ -68,11 +68,11 @@ namespace ams::fatal::srv {
} }
u64 GetQuestRebootTimeoutInterval() const { u64 GetQuestRebootTimeoutInterval() const {
return this->quest_reboot_interval_second * 1'000'000'000ul; return this->quest_reboot_interval_second * 1'000ul;
} }
u64 GetFatalRebootTimeoutInterval() const { u64 GetFatalRebootTimeoutInterval() const {
return this->fatal_auto_reboot_interval * 1'000'000ul; return this->fatal_auto_reboot_interval;
} }
const char *GetErrorMessage() const { const char *GetErrorMessage() const {

View file

@ -55,15 +55,15 @@ namespace ams::fatal::srv {
private: private:
os::Tick start_tick; os::Tick start_tick;
bool flag; bool flag;
s32 interval; s64 interval;
public: 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 { bool IsRebootTiming() const {
auto current_tick = os::GetSystemTick(); 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;
} }
}; };