dns_conf: add error logs when config is invalid.

This commit is contained in:
Nick Peng
2023-11-14 22:38:33 +08:00
parent eb9fc6c13d
commit d54d7cf80a
3 changed files with 36 additions and 12 deletions

View File

@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
static const char *current_conf_file = NULL;
static int current_conf_lineno = 0;
@@ -372,6 +373,7 @@ static int load_conf_file(const char *file, struct config_item *items, conf_erro
fp = fopen(file, "r");
if (fp == NULL) {
fprintf(stderr, "open config file '%s' failed, %s\n", file, strerror(errno));
return -1;
}