xbps_pkgdb_update: return EINVAL if pkgdb cannot be internalized.
This commit is contained in:
parent
fcdd71aac4
commit
5e97a1eb39
@ -235,10 +235,14 @@ xbps_pkgdb_update(struct xbps_handle *xhp, bool flush, bool update)
|
|||||||
|
|
||||||
/* update copy in memory */
|
/* update copy in memory */
|
||||||
if ((xhp->pkgdb = xbps_dictionary_internalize_from_file(xhp->pkgdb_plist)) == NULL) {
|
if ((xhp->pkgdb = xbps_dictionary_internalize_from_file(xhp->pkgdb_plist)) == NULL) {
|
||||||
if (errno == ENOENT)
|
rv = errno;
|
||||||
|
if (!rv)
|
||||||
|
rv = EINVAL;
|
||||||
|
|
||||||
|
if (rv == ENOENT)
|
||||||
xhp->pkgdb = xbps_dictionary_create();
|
xhp->pkgdb = xbps_dictionary_create();
|
||||||
else
|
else
|
||||||
xbps_error_printf("cannot access to pkgdb: %s\n", strerror(errno));
|
xbps_error_printf("cannot access to pkgdb: %s\n", strerror(rv));
|
||||||
|
|
||||||
cached_rv = rv = errno;
|
cached_rv = rv = errno;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user