summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-10-25 09:26:31 +0200
committerLennart Poettering <lennart@poettering.net>2016-11-02 11:29:59 -0600
commit4f14f2bb6f7402302fd4fcad6754e5ee218f4487 (patch)
tree33c802a1d3bedd402e2da2144c7b2e524d65b3c4
parent98bf5011fe670ea18b7b35d6c8ca3e84d4efbccf (diff)
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.
-rw-r--r--src/sysctl/sysctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 7117955568..cce91b3d67 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;