db: fix relative --root to work after apk_db_create call
This was broke on --initdb addition to add applet since apk_db_create changes the working directory.cute-signatures
parent
3e6fc1389f
commit
6b6c10cdf2
|
@ -638,6 +638,7 @@ int apk_db_open(struct apk_database *db, const char *root)
|
||||||
list_init(&db->installed.packages);
|
list_init(&db->installed.packages);
|
||||||
|
|
||||||
if (root != NULL) {
|
if (root != NULL) {
|
||||||
|
fchdir(apk_cwd_fd);
|
||||||
db->root = strdup(root);
|
db->root = strdup(root);
|
||||||
db->root_fd = open(root, O_RDONLY);
|
db->root_fd = open(root, O_RDONLY);
|
||||||
if (db->root_fd < 0) {
|
if (db->root_fd < 0) {
|
||||||
|
|
Loading…
Reference in New Issue