1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-11 03:54:59 -05:00

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

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); pm_printf(ALPM_LOG_DEBUG, "config: attempting to read file %s\n", file);
fp = fopen(file, "r"); fp = fopen(file, "r");
if(fp == NULL) { 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; ret = 1;
goto cleanup; goto cleanup;
} }