Browse Source

getdtablesize: fix returning hard instead of soft rlimit

This makes the result consistent with sysconf(_SC_OPEN_MAX).
Olivier Brunel 8 years ago
parent
commit
397586625e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/legacy/getdtablesize.c

+ 1 - 1
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;
 }