mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
conf.c: Simplify .conf load/parse debug messages
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
0ec5ad6961
commit
76b5bdc2c4
1 file changed
+7
-3
+7
-3
@@ -388,13 +388,15 @@ static void tabstospaces(char *line)
|
|||||||
|
|
||||||
static int parse_conf_dynamic(char *file, struct timeval *mtime)
|
static int parse_conf_dynamic(char *file, struct timeval *mtime)
|
||||||
{
|
{
|
||||||
FILE *fp = fopen(file, "r");
|
FILE *fp;
|
||||||
|
|
||||||
|
fp = fopen(file, "r");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
_pe("Failed opening %s", file);
|
_pe("Failed opening %s", file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_d("Parsing %s", file);
|
||||||
while (!feof(fp)) {
|
while (!feof(fp)) {
|
||||||
char line[LINE_SIZE] = "";
|
char line[LINE_SIZE] = "";
|
||||||
|
|
||||||
@@ -403,7 +405,7 @@ static int parse_conf_dynamic(char *file, struct timeval *mtime)
|
|||||||
|
|
||||||
chomp(line);
|
chomp(line);
|
||||||
tabstospaces(line);
|
tabstospaces(line);
|
||||||
_d("dyn conf: %s", line);
|
_d("%s", line);
|
||||||
|
|
||||||
parse_dynamic(line, mtime);
|
parse_dynamic(line, mtime);
|
||||||
}
|
}
|
||||||
@@ -445,13 +447,15 @@ static int parse_conf(char *file)
|
|||||||
|
|
||||||
if (!silent)
|
if (!silent)
|
||||||
print(0, "Loading %sconfiguration", line);
|
print(0, "Loading %sconfiguration", line);
|
||||||
|
|
||||||
|
_d("Parsing %s", file);
|
||||||
while (!feof(fp)) {
|
while (!feof(fp)) {
|
||||||
if (!fgets(line, sizeof(line), fp))
|
if (!fgets(line, sizeof(line), fp))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
chomp(line);
|
chomp(line);
|
||||||
tabstospaces(line);
|
tabstospaces(line);
|
||||||
_d("conf: %s", line);
|
_d("%s", line);
|
||||||
|
|
||||||
parse_static(line);
|
parse_static(line);
|
||||||
parse_dynamic(line, NULL);
|
parse_dynamic(line, NULL);
|
||||||
|
|||||||
Reference in new issue
Block a user