Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Reports real errors in pkg_init().
jlaffaye committed 14 years ago
commit 3aa8526c860df0c721700a46ac2f310611456a5a
parent 023269b
1 file changed +7 -0
modified libpkg/pkg_config.c
@@ -3,6 +3,7 @@

#include <assert.h>
#include <err.h>
+
#include <errno.h>
#include <stdlib.h>
#include <string.h>

@@ -268,6 +269,10 @@ pkg_init(const char *path)
		path = "/etc/pkg.conf";

	if ((fp = fopen(path, "r")) == NULL) {
+
		if (errno != ENOENT) {
+
			pkg_emit_errno("fopen", path);
+
			return (EPKG_FATAL);
+
		}
		/* no configuration present */
		parsed = true;
		return (EPKG_OK);
@@ -318,5 +323,7 @@ pkg_shutdown(void)
		return (EPKG_FATAL);
	}

+
	parsed = false;
+

	return (EPKG_OK);
}