Disable IOKit notification handling

This commit is contained in:
Sergey Bugaev 2019-02-23 14:53:36 +03:00
parent 1d7eef9a7e
commit 250e8a5ce4
2 changed files with 6 additions and 0 deletions

View File

@ -127,6 +127,7 @@ IOPowerWatcher::setupDarkWake()
IOPowerWatcher::IOPowerWatcher() :
mKernelPort(0), mIOPMconn(NULL), mIOPMqueue(NULL), mDarkWakeGroup(NULL), mUserActiveHandle(NULL)
{
#ifndef DARLING
if (!(mKernelPort = ::IORegisterForSystemPower(this, &mPortRef, ioCallback, &mHandle)))
UnixError::throwMe(EINVAL); // no clue
@ -140,6 +141,7 @@ IOPowerWatcher::IOPowerWatcher() :
mDarkWakeGroup = dispatch_group_create();
dispatch_group_enter(mDarkWakeGroup);
dispatch_async(mIOPMqueue, ^ { setupDarkWake(); });
#endif
}
IOPowerWatcher::~IOPowerWatcher()
@ -239,7 +241,9 @@ void IOPowerWatcher::ioCallback(void *refCon, io_service_t service,
//
PortPowerWatcher::PortPowerWatcher()
{
#ifndef DARLING
port(IONotificationPortGetMachPort(mPortRef));
#endif
}
boolean_t PortPowerWatcher::handle(mach_msg_header_t *in)

View File

@ -58,8 +58,10 @@ Server::Server(CodeSignatures &signatures, const char *bootstrapName)
// make me eternal (in the object mesh)
ref();
#ifndef DARLING
// engage the subsidiary port handler for sleep notifications
add(sleepWatcher);
#endif
}