Skip to content

Commit

Permalink
Do not call original method AppleRTC::setupDateTimeAlarm if sleepServ…
Browse files Browse the repository at this point in the history
…iceWake is set
  • Loading branch information
lvs1974 committed Nov 2, 2020
1 parent 21fdaa4 commit 16e4a7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion HibernationFixup/kern_hbfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,13 @@ IOReturn HBFX::IOPMrootDomain_setMaintenanceWakeCalendar(IOPMrootDomain* that, I

IOReturn HBFX::AppleRTC_setupDateTimeAlarm(void *that, void* rctDateTime)
{
DBGLOG("HBFX", "AppleRTC_setupDateTimeAlarm is called, set alarm to seconds: %lld", callbackHBFX->convertDateTimeToSeconds(rctDateTime));
DBGLOG("HBFX", "AppleRTC::setupDateTimeAlarm is called, set alarm to seconds: %lld", callbackHBFX->convertDateTimeToSeconds(rctDateTime));

if (callbackHBFX->sleepServiceWake) {
DBGLOG("HBFX", "AppleRTC::setupDateTimeAlarm called after sleepServiceWake is set");
return KERN_SUCCESS;
}

IOPMrootDomain * pmRootDomain = reinterpret_cast<IOService*>(that)->getPMRootDomain();
if (pmRootDomain) {
uint32_t delta_time = 0;
Expand Down

0 comments on commit 16e4a7a

Please sign in to comment.