[launchd-changes] [23080] trunk/launchd/src/launchctl.c
source_changes at macosforge.org
source_changes at macosforge.org
Fri Feb 16 10:12:03 PST 2007
Revision: 23080
http://trac.macosforge.org/projects/launchd/changeset/23080
Author: zarzycki at apple.com
Date: 2007-02-16 10:12:03 -0800 (Fri, 16 Feb 2007)
Log Message:
-----------
Small boot time optimization.
Modified Paths:
--------------
trunk/launchd/src/launchctl.c
Modified: trunk/launchd/src/launchctl.c
===================================================================
--- trunk/launchd/src/launchctl.c 2007-02-16 17:45:28 UTC (rev 23079)
+++ trunk/launchd/src/launchctl.c 2007-02-16 18:12:03 UTC (rev 23080)
@@ -2455,16 +2455,20 @@
const char *remount_tool[] = { "mount", "-uw", "/", NULL };
struct statfs sfs;
- if (assumes(statfs("/", &sfs) != -1)) {
- if (!(sfs.f_flags & MNT_RDONLY)) {
- fprintf(stdout, "Root file system is read-write, skipping fsck.\n");
- return;
- }
+ if (!assumes(statfs("/", &sfs) != -1)) {
+ return;
}
+ if (!(sfs.f_flags & MNT_RDONLY)) {
+ return;
+ }
+
if (!is_safeboot()) {
- if (fwexec(fsck_tool, true) != -1)
+ if (sfs.f_flags & MNT_JOURNALED) {
goto out;
+ } else if (fwexec(fsck_tool, true) != -1) {
+ goto out;
+ }
}
if (fwexec(safe_fsck_tool, true) != -1) {
@@ -2475,6 +2479,16 @@
return;
out:
+ /*
+ * Once this is fixed:
+ *
+ * <rdar://problem/3948774> Mount flag updates should be possible with NULL as the forth argument to mount()
+ *
+ * We can then do this one system call instead of calling out a full blown process.
+ *
+ * assumes(mount(sfs.f_fstypename, "/", MNT_UPDATE, NULL) != -1);
+ */
+
assumes(fwexec(remount_tool, true) != -1);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070216/8ba8ba92/attachment.html
More information about the launchd-changes
mailing list