ladybird/Ports/patch/patches/0001-Remove-oversized-dirfd-cache.patch

25 lines
683 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Wed, 10 Nov 2021 02:07:36 +0100
Subject: [PATCH] Remove oversized dirfd cache
---
src/safe.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/safe.c b/src/safe.c
index 5a7202f..562a791 100644
--- a/src/safe.c
+++ b/src/safe.c
@@ -98,9 +98,7 @@ static void init_dirfd_cache (void)
{
struct rlimit nofile;
- max_cached_fds = 8;
- if (getrlimit (RLIMIT_NOFILE, &nofile) == 0)
- max_cached_fds = MAX (nofile.rlim_cur / 4, max_cached_fds);
+ max_cached_fds = 64;
cached_dirfds = hash_initialize (max_cached_fds,
NULL,