Revision
23900
Author
dsorresso@apple.com
Date
2009-04-17 14:38:42 -0700 (Fri, 17 Apr 2009)

Log Message

<rdar://problem/6787049> 10A330 won't shut down: launchd still alive with 13/6 (normal/anon) children

Modified Paths

Diff

Modified: trunk/launchd/src/launchd_core_logic.c (23899 => 23900)


--- trunk/launchd/src/launchd_core_logic.c	2009-04-17 21:37:51 UTC (rev 23899)
+++ trunk/launchd/src/launchd_core_logic.c	2009-04-17 21:38:42 UTC (rev 23900)
@@ -2919,7 +2919,7 @@
 		return;
 	}
 
-	if (j->sampling_complete || j->per_user) {
+	if( !job_assumes(j, !j->sampling_complete) ) {
 		return;
 	}
 
@@ -3342,6 +3342,10 @@
 		 *    with the long SIGKILL
 		 */
 		
+		if( j->per_user ) {
+			/* Don't sample per-user launchd's. */
+			j->sampling_complete = true;
+		}
 		bool was_is_or_will_be_sampled = ( j->sampling_complete || j->is_being_sampled || j->pending_sample );
 		bool should_enqueue = ( !was_is_or_will_be_sampled && do_apple_internal_logging );