[launchd-changes] [23621] trunk/launchd/src/launchd_runtime.c

source_changes at macosforge.org source_changes at macosforge.org
Mon May 5 16:31:03 PDT 2008


Revision: 23621
          http://trac.macosforge.org/projects/launchd/changeset/23621
Author:   zarzycki at apple.com
Date:     2008-05-05 16:31:03 -0700 (Mon, 05 May 2008)

Log Message:
-----------
<rdar://problem/5856084> 10A43: NFS trying to connect to servers after the VPN is down

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

Modified: trunk/launchd/src/launchd_runtime.c
===================================================================
--- trunk/launchd/src/launchd_runtime.c	2008-05-05 20:23:42 UTC (rev 23620)
+++ trunk/launchd/src/launchd_runtime.c	2008-05-05 23:31:03 UTC (rev 23621)
@@ -37,6 +37,7 @@
 #include <mach/exception.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/sysctl.h>
 #include <sys/time.h>
 #include <sys/proc.h>
 #include <sys/event.h>
@@ -147,6 +148,7 @@
 {
 	mach_msg_size_t mxmsgsz;
 	pthread_attr_t attr;
+	pid_t p = getpid();
 
 	launchd_assert((mainkq = kqueue()) != -1);
 
@@ -175,6 +177,8 @@
 	pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
 	launchd_assert(pthread_create(&demand_thread, &attr, mport_demand_loop, NULL) == 0);
 	pthread_attr_destroy(&attr);
+
+	launchd_assumes(sysctlbyname("vfs.generic.noremotehang", NULL, NULL, &p, sizeof(p)) != -1);
 }
 
 INTERNAL_ABI void
@@ -731,6 +735,9 @@
 		launchd_assumes(sigprocmask(SIG_SETMASK, &oset, NULL) != -1);
 		launchd_assumes(launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS);
 	} else {
+		pid_t p = -getpid();
+		launchd_assumes(sysctlbyname("vfs.generic.noremotehang", NULL, NULL, &p, sizeof(p)) != -1);
+
 		launchd_assumes(sigprocmask(SIG_SETMASK, &emptyset, NULL) != -1);
 	}
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080505/2da395ae/attachment.html


More information about the launchd-changes mailing list