Commit 38e54240 authored by Natanael Copa's avatar Natanael Copa

db: remount read-only after the file handles have been closed

The apk cache might be on the readonly media so we need wait with
remounting til after atleast this filehandle is closed.
parent 2332d991
......@@ -1397,12 +1397,6 @@ void apk_db_close(struct apk_database *db)
struct hlist_node *dc, *dn;
int i;
if (db->cache_remount_dir) {
do_remount(db->cache_remount_dir, "ro");
free(db->cache_remount_dir);
db->cache_remount_dir = NULL;
}
apk_id_cache_free(&db->id_cache);
list_for_each_entry(ipkg, &db->installed.packages, installed_pkgs_list) {
......@@ -1436,6 +1430,12 @@ void apk_db_close(struct apk_database *db)
close(db->lock_fd);
if (db->root != NULL)
free(db->root);
if (db->cache_remount_dir) {
do_remount(db->cache_remount_dir, "ro");
free(db->cache_remount_dir);
db->cache_remount_dir = NULL;
}
}
static int fire_triggers(apk_hash_item item, void *ctx)
......
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