summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/database.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c
index b7aff18..4889289 100644
--- a/src/database.c
+++ b/src/database.c
@@ -2653,8 +2653,13 @@ static void apk_db_migrate_files(struct apk_database *db,
unlinkat(db->root_fd, tmpname, 0);
} else {
/* Overwrite the old file */
- renameat(db->root_fd, tmpname,
- db->root_fd, name);
+ if(renameat(db->root_fd, tmpname,
+ db->root_fd, name) != 0)
+ {
+ apk_error("%s -> %s: failed to rename",
+ tmpname, name);
+ ipkg->broken_files = 1;
+ }
}
/* Claim ownership of the file in db */