<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Avoid potential libdispatch crash when we close its fds.
--- compat/closefrom.c.orig
+++ compat/closefrom.c
@@ -27,6 +27,7 @@
 #include &lt;sys/time.h&gt; /* for &lt;sys/resource.h&gt; */
 #include &lt;sys/resource.h&gt; /* getrlimit() */
 #include &lt;unistd.h&gt;
+#include &lt;fcntl.h&gt;
 #include &lt;errno.h&gt; /* errno */
 #include &lt;sys/select.h&gt; /* FD_SETSIZE */
 
@@ -74,7 +75,11 @@
 	}
 
 	while ((unsigned)fd &lt; lim.rlim_max)
+#ifdef __APPLE__
+		if (fcntl (fd++, F_SETFD, FD_CLOEXEC) != -1)
+#else
 		if (close (fd++) == 0)
+#endif
 			found++;
 
 	if (found == 0)
</pre></body></html>