Skip to content

Commit 4c679ee

Browse files
committed
bin/xbps-alternatives: work around pkgdb not having an init function
1 parent 61c3df0 commit 4c679ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/xbps-alternatives/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,11 @@ main(int argc, char **argv)
346346
exit(EXIT_FAILURE);
347347
}
348348
if (set_mode) {
349+
// XXX: xbps_pkgdb_init
350+
(void)xbps_pkgdb_get_pkg(&xh, "foo");
351+
349352
/* in set mode pkgdb must be locked and flushed on success */
350-
if ((rv = xbps_pkgdb_lock(&xh)) != 0) {
353+
if (xbps_pkgdb_lock(&xh) < 0) {
351354
xbps_error_printf("failed to lock pkgdb: %s\n", strerror(rv));
352355
xbps_end(&xh);
353356
exit(EXIT_FAILURE);

0 commit comments

Comments
 (0)