Skip to content

Commit 75cfcf3

Browse files
committed
bin/xbps-remove: fix concurrency issue in --clean-cache
1 parent 5088da3 commit 75cfcf3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/xbps-remove/clean-cache.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ clean_cachedir(struct xbps_handle *xhp, bool uninstalled, bool drun)
145145
char *ext;
146146
int rv = 0;
147147

148+
// XXX: there is no public api to load the pkgdb so force it before
149+
// its done potentially concurrently by threads through the
150+
// xbps_array_foreach_cb_multi call later.
151+
(void)xbps_pkgdb_get_pkg(xhp, "foo");
152+
148153
if (chdir(xhp->cachedir) == -1)
149154
return -1;
150155

0 commit comments

Comments
 (0)