getdtablesize: fix returning hard instead of soft rlimit

This makes the result consistent with sysconf(_SC_OPEN_MAX).
This commit is contained in:
Olivier Brunel authored and Rich Felker committed 2016-08-30 16:15:22 -04:00
1 parent c1f4ed1501
commit 397586625e
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}