summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2017-06-26 00:51:38 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2017-06-26 00:51:38 +0000
commit5644012df62e0d09f12717a365f74795f030135b (patch)
tree5c5dbe9df7944cc3f55c1de5a2c42d13eb6128c0 /src
parent7044d92bd11b3f184b64cf6f187b2bd86e2dc6bb (diff)
downloadapk-tools-5644012df62e0d09f12717a365f74795f030135b.tar.gz
apk-tools-5644012df62e0d09f12717a365f74795f030135b.tar.bz2
apk-tools-5644012df62e0d09f12717a365f74795f030135b.tar.xz
apk-tools-5644012df62e0d09f12717a365f74795f030135b.zip
database: mark error on renameat failure
Diffstat (limited to 'src')
-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 */