How can my daemon detect that machine is restarted
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hi, Here is my code that registers for the notification. I do get kIOMessageCanSystemSleep when the system is put to sleep. Is there a better way to find out if the machine is restarted? Thanks, Martin _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I need to find out if my daemon was launched after a restart or during the normal install. Basically I need to now if a machine was restarted. I thought IORegisterForSystemPower would do this but I do not get the kIOMessageSystemWillRestart message. gRootPort=IORegisterForSystemPower (0,¬ify,SystemPowerChangedCallback,&anIterator); if (gRootPort) CFRunLoopAddSource(CFRunLoopGetCurrent (),IONotificationPortGetRunLoopSource(notify),kCFRunLoopDefaultMode); It could be that my daemon gets killed before I get the kIOMessageSystemWillRestart message. This email sent to site_archiver@lists.apple.com
participants (1)
-
Martin Bestmann