[launchd-changes] [23098] trunk/launchd/src/launchctl.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 22 14:41:39 PST 2007


Revision: 23098
          http://trac.macosforge.org/projects/launchd/changeset/23098
Author:   zarzycki at apple.com
Date:     2007-02-22 14:41:38 -0800 (Thu, 22 Feb 2007)

Log Message:
-----------
I shot myself in the foot with the 'bootstrap' subcommand. This makes it possible to run from single user mode again.

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

Modified: trunk/launchd/src/launchctl.c
===================================================================
--- trunk/launchd/src/launchctl.c	2007-02-22 18:22:46 UTC (rev 23097)
+++ trunk/launchd/src/launchctl.c	2007-02-22 22:41:38 UTC (rev 23098)
@@ -1345,9 +1345,10 @@
 
 	if (!path_check("/System/Library/LoginPlugins/BootCache.loginPlugin")) {
 		int remaining_sec = 60 - tvd.tv_sec;
+
 		if (remaining_sec > 0) {
 			sleep(remaining_sec);
-		}
+		}	
 
 		const char *bcc_stop_tool[] = { "BootCacheControl", "stop", NULL };
 		assumes(fwexec(bcc_stop_tool, true) != -1);
@@ -1357,9 +1358,9 @@
 int
 bootstrap_cmd(int argc, char *const argv[] __attribute__((unused)))
 {
-	if (getpid() == 2 && getuid() == 0) {
+	if (getuid() == 0) {
 		very_pid2_specific_bootstrap(argc == 2);
-	} else if (getuid() != 0) {
+	} else {
 		char *load_launchd_items[] = { "load", "-D", "all", "-S", "Background", NULL };
 
 		if (is_safeboot()) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070222/0d50629e/attachment.html


More information about the launchd-changes mailing list