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

source_changes at macosforge.org source_changes at macosforge.org
Tue May 8 11:17:51 PDT 2007


Revision: 23246
          http://trac.macosforge.org/projects/launchd/changeset/23246
Author:   zarzycki at apple.com
Date:     2007-05-08 11:17:51 -0700 (Tue, 08 May 2007)

Log Message:
-----------
Improved logging.

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-05-07 21:52:13 UTC (rev 23245)
+++ trunk/launchd/src/launchd_core_logic.c	2007-05-08 18:17:51 UTC (rev 23246)
@@ -1670,7 +1670,8 @@
 	job_t ji;
 
 	if (jm->jm_port == mport) {
-		return jobmgr_find_by_pid(jm, upid, true);
+		jobmgr_assumes(jm, (ji = jobmgr_find_by_pid(jm, upid, true)) != NULL);
+		return ji;
 	}
 
 	SLIST_FOREACH(jmi, &jm->submgrs, sle) {
@@ -1708,7 +1709,7 @@
 		mib[3] = ldc.pid;
 
 		if (jobmgr_assumes(root_jobmgr, sysctl(mib, 4, &kp, &len, NULL, 0) != -1)) {
-			jobmgr_log(root_jobmgr, LOG_ERR, "%s() was confused by PID %u: %s", __func__, ldc.pid, kp.kp_proc.p_comm);
+			jobmgr_log(root_jobmgr, LOG_ERR, "%s() was confused by PID %u UID %u EUID %u Mach Port 0x%x: %s", __func__, ldc.pid, ldc.uid, ldc.euid, p, kp.kp_proc.p_comm);
 		}
 	}
 
@@ -5226,7 +5227,8 @@
 		goto out;
 	}
 
-	if (getpid() != 1 && job_mig_intran(target_subset)) {
+	/* We call job_mig_intran2 because job_mig_intran logs on failure */
+	if (getpid() != 1 && job_mig_intran2(root_jobmgr, target_subset, getpid())) {
 		kr = 0;
 		goto out;
 	}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070508/365625ae/attachment.html


More information about the launchd-changes mailing list