Revision
23107
Author
zarzycki@apple.com
Date
2007-02-23 14:57:41 -0800 (Fri, 23 Feb 2007)

Log Message

Move some code to a better place.

Modified Paths

Diff

Modified: trunk/launchd/src/launchctl.c (23106 => 23107)


--- trunk/launchd/src/launchctl.c	2007-02-23 22:02:02 UTC (rev 23106)
+++ trunk/launchd/src/launchctl.c	2007-02-23 22:57:41 UTC (rev 23107)
@@ -205,8 +205,6 @@
 {
 	char *l;
 
-	do_sysversion_sysctl();
-
 	istty = isatty(STDIN_FILENO);
 
 	argc--, argv++;
@@ -1243,6 +1241,8 @@
 	int hnmib[] = { CTL_KERN, KERN_HOSTNAME };
 	struct group *tfp_gr;
 
+	do_sysversion_sysctl();
+
 	do_single_user_mode(sflag);
 
 	assumes(gettimeofday(&tvs, NULL) != -1);
@@ -2717,9 +2717,6 @@
 
 	/* <rdar://problem/4477682> ER: launchd should set kern.osversion very early in boot */
 
-	if (getuid() != 0)
-		return;
-
 	if (sysctl(mib, 2, buf, &bufsz, NULL, 0) == -1) {
 		fprintf(stderr, "sysctl(): %s\n", strerror(errno));
 		return;