From 3b20561748ff6b36ae99ff4fc1829035240cba33 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 26 Apr 2014 12:40:40 -0400 Subject: ini.c: move error output into conf.c Move the remaining output into conf.c by notifying the callback of read errors. Signed-off-by: Andrew Gregory --- src/pacman/conf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pacman/conf.c') diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 64c83198..b31b2536 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -964,7 +964,11 @@ static int _parse_directive(const char *file, int linenum, const char *name, char *key, char *value, void *data) { struct section_t *section = data; - if(!key && !value) { + if(!name && !key && !value) { + pm_printf(ALPM_LOG_ERROR, _("config file %s could not be read: %s\n"), + file, strerror(errno)); + return 1; + } else if(!key && !value) { section->name = name; pm_printf(ALPM_LOG_DEBUG, "config: new section '%s'\n", name); if(strcmp(name, "options") == 0) { @@ -1007,9 +1011,11 @@ int parseconfig(const char *file) int ret; struct section_t section; memset(§ion, 0, sizeof(struct section_t)); + pm_printf(ALPM_LOG_DEBUG, "config: attempting to read file %s\n", file); if((ret = parse_ini(file, _parse_directive, §ion))) { return ret; } + pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s\n", file); if((ret = setup_libalpm())) { return ret; } -- cgit v1.2.3-24-g4f1b