Source
Avoid potential libdispatch crash when we close its fds.
--- compat/closefrom.c.orig
+++ compat/closefrom.c
#include <sys/time.h> /* for <sys/resource.h> */
#include <sys/resource.h> /* getrlimit() */
#include <unistd.h>
+#include <fcntl.h>
#include <errno.h> /* errno */
#include <sys/select.h> /* FD_SETSIZE */
}
while ((unsigned)fd < lim.rlim_max)
+#ifdef __APPLE__
+ if (fcntl (fd++, F_SETFD, FD_CLOEXEC) != -1)
+#else
if (close (fd++) == 0)
+#endif
found++;
if (found == 0)