Commit 6b6c10cd authored by Timo Teräs's avatar Timo Teräs

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.
parent 3e6fc138
......@@ -638,6 +638,7 @@ int apk_db_open(struct apk_database *db, const char *root)
list_init(&db->installed.packages);
if (root != NULL) {
fchdir(apk_cwd_fd);
db->root = strdup(root);
db->root_fd = open(root, O_RDONLY);
if (db->root_fd < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment