From 9ce8912e5dd48aca6a0eb05cace15e0e08ff606b Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Mon, 11 Jul 2022 14:05:48 +0200 Subject: [PATCH] Reduce MAX_OPEN_FILES to 128 on macOS where the default limit is 256 --- include/wimlib/apply.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/wimlib/apply.h b/include/wimlib/apply.h index 2592fae6..7813aee1 100644 --- a/include/wimlib/apply.h +++ b/include/wimlib/apply.h @@ -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. */ +#ifndef __APPLE__ #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) -- 2.43.0