Exemplo n.º 1
0
void Daemon::create()
{
    createPidfile();
    detachFromParent();
    savePidToPidfile();
    changeWorkingDirectory();
    closeStandardFileDescriptors();
    openNewFileDescriptors();
}
Exemplo n.º 2
0
void FileNVRAM::stop(IOService *provider)
{
	// OSSafeReleaseNULL(mFilePath);

	if (mTimer)
	{
		mTimer->cancelTimeout();
		getWorkLoop()->removeEventSource(mTimer);
		OSSafeReleaseNULL(mTimer);
	}

	if (mCommandGate)
	{
		getWorkLoop()->removeEventSource(mCommandGate);
	}

	PMstop();
	LOG(NOTICE, "Stop called, attempting to detachFromParent\n");

	IORegistryEntry* root = IORegistryEntry::fromPath("/", gIODTPlane);
	detachFromParent(root, gIODTPlane);

	LOG(NOTICE, "Stop has passed the detach point.. move along now\n");
}