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

2015-02-11 Thread Paul Eggert
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

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

2015-02-11 Thread Kevin Cernekee
* lib/getdtablesize.c: Use rlim_cur instead of rlim_max, to match glibc behavior. test-getdtablesize and test-dup2 both assume they will be able to create a file descriptor numbered (getdtablesize()-1), and will fail if rlim_max > rlim_cur. --- ChangeLog | 6 ++ lib/getdtablesize.c