]> wimlib.net Git - wimlib/commitdiff
Reduce MAX_OPEN_FILES to 128 on macOS where the default limit is 256
authorMathieu Schroeter <mathieu@schroetersa.ch>
Mon, 11 Jul 2022 12:05:48 +0000 (14:05 +0200)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 12 Jul 2022 07:09:06 +0000 (00:09 -0700)
include/wimlib/apply.h

index 2592fae6fd90da5bcd040de7b46313bcf7aa3d39..7813aee13d7df14fa101770abfeecc7b95c62c25 100644 (file)
@@ -81,7 +81,12 @@ struct apply_ctx {
 /* Maximum number of UNIX file descriptors, NTFS attributes, or Windows file
  * handles that can be opened simultaneously to extract a blob to multiple
  * destinations.  */
 /* Maximum number of UNIX file descriptors, NTFS attributes, or Windows file
  * handles that can be opened simultaneously to extract a blob to multiple
  * destinations.  */
+#ifndef __APPLE__
 #define MAX_OPEN_FILES 512
 #define MAX_OPEN_FILES 512
+#else /* !__APPLE__ */
+/* With macOS, reduce to 128 because the default value for ulimit -n is 256 */
+#define MAX_OPEN_FILES 128
+#endif /* __APPLE__ */
 
 static inline int
 extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)
 
 static inline int
 extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)