[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH] Do not leave fd_limit as an unused variable

From: Aron Barath
Subject: [Findutils-patches] [PATCH] Do not leave fd_limit as an unused variable on the stack if getrlimit is not supported.
Date: Wed, 8 Aug 2018 09:39:42 +0200

* lib/fdleak.c (get_max_fd): add guard around the fd_limit variable
 lib/fdleak.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/fdleak.c b/lib/fdleak.c
index 38ff8360..51b83cd9 100644
--- a/lib/fdleak.c
+++ b/lib/fdleak.c
@@ -109,7 +109,9 @@ get_proc_max_fd (void)
 static int
 get_max_fd (void)
+#if defined HAVE_GETRLIMIT && defined RLIMIT_NOFILE
   struct rlimit fd_limit;
   long open_max;
   open_max = get_proc_max_fd ();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]