[Top][All Lists]

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

Re: [PATCH 11/11] getdtablesize: Fix RLIMIT_NOFILE fallback case

From: Paul Eggert
Subject: Re: [PATCH 11/11] getdtablesize: Fix RLIMIT_NOFILE fallback case
Date: Wed, 11 Feb 2015 16:14:27 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Kevin Cernekee wrote:

@@ -99,8 +99,8 @@ rpl_getdtablesize(void)
       a smaller soft limit, the smaller limit is not enforced, so
       we might as well just report the hard limit.  */
    struct rlimit lim;
-  if (!getrlimit (RLIMIT_NOFILE, &lim) && lim.rlim_max != RLIM_INFINITY)
-    return lim.rlim_max;
+  if (!getrlimit (RLIMIT_NOFILE, &lim) && lim.rlim_cur != RLIM_INFINITY)
+    return lim.rlim_cur;
    return getdtablesize ();

This one doesn't look right, as it causes the code to disagree with the preceding comment. Doesn't the patch lose a Cygwin fix? That is, shouldn't the code do one thing on Cygwin, and another on other platforms where rlim_cur presumably works?

reply via email to

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