[launchd-changes] [23425] trunk/launchd/src/launchd_core_logic.c
source_changes at macosforge.org
source_changes at macosforge.org
Fri Sep 21 16:25:52 PDT 2007
Revision: 23425
http://trac.macosforge.org/projects/launchd/changeset/23425
Author: zarzycki at apple.com
Date: 2007-09-21 16:25:52 -0700 (Fri, 21 Sep 2007)
Log Message:
-----------
<rdar://problem/5487724> Leopard: M67 Hang on the way to power-off
Modified Paths:
--------------
trunk/launchd/src/launchd_core_logic.c
Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c 2007-09-21 20:36:08 UTC (rev 23424)
+++ trunk/launchd/src/launchd_core_logic.c 2007-09-21 23:25:52 UTC (rev 23425)
@@ -4122,6 +4122,19 @@
jobmgr_log(jm, LOG_DEBUG, "Garbage collecting.");
+ /*
+ * Normally, we wait for all resources of a job (Unix PIDs/FDs and Mach ports)
+ * to reset before we conider the job truly dead and ready to be spawned again.
+ *
+ * In order to work around 5487724 and 3456090, we're going to call reboot()
+ * when the last PID dies and not wait for the associated resources to reset.
+ */
+ if (getpid() == 1 && jm->parentmgr == NULL && total_children == 0) {
+ jobmgr_log(jm, LOG_DEBUG, "About to force a call to: reboot(%s)", reboot_flags_to_C_names(jm->reboot_flags));
+ runtime_closelog();
+ jobmgr_assumes(jm, reboot(jm->reboot_flags) != -1);
+ }
+
if (jm->hopefully_first_cnt) {
return jm;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070921/6accc760/attachment.html
More information about the launchd-changes
mailing list