From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10375 Path: news.gmane.org!.POSTED!not-for-mail From: Olivier Brunel Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] getdtablesize: Fix returning hard instead of soft rlimit Date: Sat, 13 Aug 2016 20:31:49 +0200 Message-ID: <20160813183149.6886-1-jjk@jjacky.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1471113224 3840 195.159.176.226 (13 Aug 2016 18:33:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2016 18:33:44 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10388-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 13 20:33:40 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bYdka-0000nT-FG for gllmg-musl@m.gmane.org; Sat, 13 Aug 2016 20:33:40 +0200 Original-Received: (qmail 26574 invoked by uid 550); 13 Aug 2016 18:33:38 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26542 invoked from network); 13 Aug 2016 18:33:36 -0000 X-Mailer: git-send-email 2.9.2 Xref: news.gmane.org gmane.linux.lib.musl.general:10375 Archived-At: --- src/legacy/getdtablesize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacy/getdtablesize.c b/src/legacy/getdtablesize.c index 682da6d..b30c193 100644 --- a/src/legacy/getdtablesize.c +++ b/src/legacy/getdtablesize.c @@ -7,5 +7,5 @@ int getdtablesize(void) { struct rlimit rl; getrlimit(RLIMIT_NOFILE, &rl); - return rl.rlim_max < INT_MAX ? rl.rlim_max : INT_MAX; + return rl.rlim_cur < INT_MAX ? rl.rlim_cur : INT_MAX; } -- 2.9.2