aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c
index 7a0bb5d7cf..c505dba60e 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1593,7 +1593,7 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
/* figure out where to have the cache */
fd = openat(db->root_fd, apk_linked_cache_dir, O_RDONLY | O_CLOEXEC);
- if (fd >= 0 && fstatfs(fd, &stfs) == 0 && stfs.f_type != TMPFS_MAGIC) {
+ if (fd >= 0) {
db->cache_dir = apk_linked_cache_dir;
db->cache_fd = fd;
db->cache_remount_flags = map_statfs_flags(stfs.f_flags);
@@ -1612,8 +1612,6 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
}
}
} else {
- if (fd >= 0)
- close(fd);
db->cache_dir = apk_static_cache_dir;
db->cache_fd = openat(db->root_fd, db->cache_dir, O_RDONLY | O_CLOEXEC);
}