Revision
22923
Author
zarzycki@apple.com
Date
2006-10-26 11:57:29 -0700 (Thu, 26 Oct 2006)

Log Message

Let's not pay the getpwuid() hit unless we have to...

Modified Paths

Diff

Modified: trunk/launchd/src/launchd_core_logic.c (22922 => 22923)


--- trunk/launchd/src/launchd_core_logic.c	2006-10-26 18:56:25 UTC (rev 22922)
+++ trunk/launchd/src/launchd_core_logic.c	2006-10-26 18:57:29 UTC (rev 22923)
@@ -4054,7 +4054,9 @@
 		return BOOTSTRAP_NO_MEMORY;
 	}
 
-	jr->mach_uid = ldc.uid;
+	if (getuid() == 0) {
+		jr->mach_uid = ldc.uid;
+	}
 
 	if (!job_setup_machport(jr)) {
 		job_remove(jr);