Revision
23020
Author
zarzycki@apple.com
Date
2007-01-23 10:56:20 -0800 (Tue, 23 Jan 2007)

Log Message

<rdar://problem/4944456> mount_smbfs hangs at login time

Modified Paths

Diff

Modified: trunk/launchd/src/launchd.c (23019 => 23020)


--- trunk/launchd/src/launchd.c	2007-01-22 21:28:52 UTC (rev 23019)
+++ trunk/launchd/src/launchd.c	2007-01-23 18:56:20 UTC (rev 23020)
@@ -290,7 +290,16 @@
 		}
 	}
 
-	if (stat(ldconf, &sb) == 0) {
+	/*
+	 * We cannot stat() anything in the home directory right now.
+	 *
+	 * The per-user launchd can easily be demand launched by the tool doing
+	 * the mount of the home directory. The result is an ugly deadlock.
+	 *
+	 * We hope to someday have a non-blocking stat(), but for now, we have
+	 * to skip it.
+	 */
+	if (!h && stat(ldconf, &sb) == 0) {
 		job_dispatch(rlcj, true);
 	}