From: Zbigniew Jędrzejewski-Szmek Date: Mon, 27 Nov 2017 22:01:48 +0000 (+0000) Subject: pid1: clarify that min_max is always initialized X-Git-Tag: v236~102^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d387cfdddd7a843cb6538186ae32222b6d7690a1;p=platform%2Fupstream%2Fsystemd.git 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. --- diff --git a/src/core/main.c b/src/core/main.c index d779461..b7fb9b3 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -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)