[launchd-changes] [23586] trunk/launchd/src/launchd_core_logic.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 2 13:22:03 PDT 2008


Revision: 23586
          http://trac.macosforge.org/projects/launchd/changeset/23586
Author:   zarzycki at apple.com
Date:     2008-04-02 13:22:03 -0700 (Wed, 02 Apr 2008)

Log Message:
-----------
<rdar://problem/5835375> 10.5.3 Regression: Failure to shutdown in 9D11 with zombie shutdown

Modified Paths:
--------------
    trunk/launchd/src/launchd_core_logic.c

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2008-04-02 20:18:49 UTC (rev 23585)
+++ trunk/launchd/src/launchd_core_logic.c	2008-04-02 20:22:03 UTC (rev 23586)
@@ -4175,7 +4175,7 @@
 	} else if (j->removal_pending) {
 		job_log(j, LOG_DEBUG, "Exited while removal was pending.");
 		return true;
-	} else if (j->mgr->shutting_down && j->mgr->hopefully_first_cnt == 0) {
+	} else if (j->mgr->shutting_down && (j->hopefully_exits_first || j->mgr->hopefully_first_cnt == 0)) {
 		job_log(j, LOG_DEBUG, "Exited while shutdown in progress. Processes remaining: %lu/%lu", total_children, total_anon_children);
 		return true;
 	} else if (j->legacy_mach_job) {
@@ -4202,13 +4202,17 @@
 	bool good_exit = (WIFEXITED(j->last_exit_status) && WEXITSTATUS(j->last_exit_status) == 0);
 	bool is_not_kextd = (do_apple_internal_logging || (strcmp(j->label, "com.apple.kextd") != 0));
 
+	if (unlikely(j->mgr->shutting_down)) {
+		return false;
+	}
+
 	/*
 	 * 5066316
 	 *
 	 * We definitely need to revisit this after Leopard ships. Please see
 	 * launchctl.c for the other half of this hack.
 	 */
-	if (unlikely((j->mgr->shutting_down || j->mgr->global_on_demand_cnt > 0) && is_not_kextd)) {
+	if (unlikely((j->mgr->global_on_demand_cnt > 0) && is_not_kextd)) {
 		return false;
 	}
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080402/8d65dc0c/attachment.html


More information about the launchd-changes mailing list