summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Runge <mrunge@google.com>2014-10-23 22:44:55 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-23 22:44:55 +0200
commite2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d (patch)
tree8ef441cbc945ff2fb16138e18c205e7f68f9e0af
parentam 0745fbfa: am c7249660: am 4f66469b: Merge "More test makefile cleanup." (diff)
parentam 3b5c6dca: am 2f0ef730: Treat already-renamed files as having no problems. (diff)
downloadandroid_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.tar
android_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.tar.gz
android_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.tar.bz2
android_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.tar.lz
android_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.tar.xz
android_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.tar.zst
android_bootable_recovery-e2aa0b8ad6258504cb6b5a6f1a579dcf2104ef6d.zip
-rw-r--r--updater/install.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/updater/install.c b/updater/install.c
index dad0d08c9..42dbb58da 100644
--- a/updater/install.c
+++ b/updater/install.c
@@ -358,6 +358,9 @@ Value* RenameFn(const char* name, State* state, int argc, Expr* argv[]) {
if (make_parents(dst_name) != 0) {
ErrorAbort(state, "Creating parent of %s failed, error %s",
dst_name, strerror(errno));
+ } else if (access(dst_name, F_OK) == 0 && access(src_name, F_OK) != 0) {
+ // File was already moved
+ result = dst_name;
} else if (rename(src_name, dst_name) != 0) {
ErrorAbort(state, "Rename of %s to %s failed, error %s",
src_name, dst_name, strerror(errno));