Commit 17dd532e authored by A. Wilcox's avatar A. Wilcox Committed by Timo Teräs

database: mark error on renameat failure

parent 6f9dd590
......@@ -2652,8 +2652,12 @@ 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(PKG_VER_FMT": failed to rename %s to %s.",
PKG_VER_PRINTF(ipkg->pkg), tmpname, name);
ipkg->broken_files = 1;
/* Claim ownership of the file in db */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment