Skip to content

Commit

Permalink
Merge pull request #28 from daxtens/master
Browse files Browse the repository at this point in the history
poll2: update rlim.rlim_cur if it's too low
  • Loading branch information
antonblanchard authored Jan 6, 2021
2 parents b8eb1d1 + 819b0a2 commit 566ada2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/poll2.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ void testcase_prepare(unsigned long nr_tasks)
rlim_t new_lim = (NR_FILES + 10) * nr_procs;

getrlimit(RLIMIT_NOFILE, &rlim);
if( rlim.rlim_max < new_lim) {
if (rlim.rlim_max < new_lim) {
rlim.rlim_cur = new_lim;
rlim.rlim_max = new_lim;
}
if (rlim.rlim_cur < new_lim) {
rlim.rlim_cur = new_lim;
}
assert(setrlimit(RLIMIT_NOFILE, &rlim) == 0);
}

Expand Down

0 comments on commit 566ada2

Please sign in to comment.