From: Lennart Poettering Date: Tue, 25 Oct 2016 07:26:31 +0000 (+0200) Subject: sysctl: no need to check for eof twice X-Git-Tag: v234~873^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f14f2bb6f7402302fd4fcad6754e5ee218f4487;p=platform%2Fupstream%2Fsystemd.git sysctl: no need to check for eof twice Let's only check for eof once after the fgets(). There's no point in checking EOF before the first read, and twice in each loop. --- diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 7117955..cce91b3 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -104,7 +104,7 @@ static int parse_file(OrderedHashmap *sysctl_options, const char *path, bool ign } log_debug("Parsing %s", path); - while (!feof(f)) { + for (;;) { char l[LINE_MAX], *p, *value, *new_value, *property, *existing; void *v; int k;