summaryrefslogtreecommitdiff
path: root/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-26 21:39:06 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-26 21:39:06 +0100
commit87f0e418cf2c58b3201d06a60e3696ec672d2662 (patch)
treea27ef34fdf69505d983852d36d200b6e590726df /conf-parser.c
parentfd79db6a5df0f94c48736ce5aa0131d6ab108fb0 (diff)
s/name/unit
Diffstat (limited to 'conf-parser.c')
-rw-r--r--conf-parser.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/conf-parser.c b/conf-parser.c
index c7f48eafef..78078cc0b9 100644
--- a/conf-parser.c
+++ b/conf-parser.c
@@ -109,7 +109,7 @@ static int parse_line(const char *filename, unsigned line, char **section, const
}
}
- r = config_parse(fn, sections, t, userdata);
+ r = config_parse(fn, NULL, sections, t, userdata);
free(path);
return r;
}
@@ -162,19 +162,20 @@ static int parse_line(const char *filename, unsigned line, char **section, const
}
/* Go through the file and parse each line */
-int config_parse(const char *filename, const char* const * sections, const ConfigItem *t, void *userdata) {
+int config_parse(const char *filename, FILE *f, const char* const * sections, const ConfigItem *t, void *userdata) {
unsigned line = 0;
char *section = NULL;
- FILE *f;
int r;
assert(filename);
assert(t);
- if (!(f = fopen(filename, "re"))) {
- r = -errno;
- log_error("Failed to open configuration file '%s': %s", filename, strerror(-r));
- goto finish;
+ if (!f) {
+ if (!(f = fopen(filename, "re"))) {
+ r = -errno;
+ log_error("Failed to open configuration file '%s': %s", filename, strerror(-r));
+ goto finish;
+ }
}
while (!feof(f)) {