pid1: clarify that min_max is always initialized

read_one_line_file() always returns <= 0, so the code was OK, but let's write
the check a bit differently to make it obvious that min_max is always set.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-11-28 09:26:14 +01:00
parent 7beb3baf16
commit d387cfdddd
+1 -1
View File
@@ -1237,7 +1237,7 @@ static int bump_rlimit_nofile(struct rlimit *saved_rlimit) {
/* Get current RLIMIT_NOFILE maximum compiled into the kernel. */
r = read_one_line_file("/proc/sys/fs/nr_open", &nr_open);
if (r == 0)
if (r >= 0)
r = safe_atoi(nr_open, &min_max);
/* If we fail, fallback to the hard-coded kernel limit of 1024 * 1024. */
if (r < 0)