Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 13 Aug 2016 21:36:13 +0200
From: Olivier Brunel <jjk@...cky.com>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] getdtablesize: Fix returning hard instead of
 soft rlimit

On Sat, 13 Aug 2016 15:25:02 -0400
Rich Felker <dalias@...c.org> wrote:

> On Sat, Aug 13, 2016 at 08:31:49PM +0200, Olivier Brunel wrote:
> > ---
> >  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;  
> 
> Is there a motivation for this?
> 
> Rich

Well, I found this running tests for findutils, and having a couple
failing because of it. I'm not sure about possible
implications/issues it could cause in the actual tools, was only trying
to get the tests to pass (and things to work as expected), but I
wasn't facing an "actual" issue/bug, if that was the question.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.