mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-26 19:47:42 +00:00
Implement IOKit system sleep and wake notifications through logind
This commit is contained in:
1 parent
084e003f79
commit
e2f1392369
9 files changed
+2921
-17
No files matched your search
@@ -7,10 +7,10 @@ index 81ed8f7..3120abb 100644
|
||||
Boolean cfReusedPort = false;
|
||||
|
||||
+#ifdef DARLING
|
||||
+ /* Fail soft instead of crashing: without iokitd some registry/power
|
||||
+ * lookups never produce a port, and callers (e.g. Chromium's power
|
||||
+ * monitor) pass the NULL through unchecked. CFRunLoopAddSource
|
||||
+ * already ignores NULL sources, so returning NULL here is safe. */
|
||||
+ /* A notification port can still be absent when allocation fails or
|
||||
+ * the IOKit service is unavailable. Keep the accessor tolerant of
|
||||
+ * that failure; CFRunLoopAddSource already ignores NULL sources.
|
||||
+ * Normal power registration is implemented by iokitd. */
|
||||
+ if (!notify)
|
||||
+ return NULL;
|
||||
+#endif
|
||||
|
||||
Reference in new issue
Block a user