pacman: be more descriptive when opening an include fails

if fopen returns NULL, append the libc strerror-ized error message to
our own error message.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dave Reisner 2012-07-03 23:53:24 -04:00 committed by Dan McGee
parent e0daaea38c
commit 392fffe241
1 changed files with 2 additions and 1 deletions

View File

@ -720,7 +720,8 @@ static int _parseconfig(const char *file, struct section_t *section,
pm_printf(ALPM_LOG_DEBUG, "config: attempting to read file %s\n", file);
fp = fopen(file, "r");
if(fp == NULL) {
pm_printf(ALPM_LOG_ERROR, _("config file %s could not be read.\n"), file);
pm_printf(ALPM_LOG_ERROR, _("config file %s could not be read: %s\n"),
file, strerror(errno));
ret = 1;
goto cleanup;
}