summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Runge <mrunge@google.com>2014-10-23 22:40:59 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-23 22:40:59 +0200
commitc224ac28adf1248dcd5716a0c6ed77825418fe0d (patch)
tree0c800fd6e40de31fd681b7a3360ea4acb7ffd7c2
parentam c7249660: am 4f66469b: Merge "More test makefile cleanup." (diff)
parentam 2f0ef730: Treat already-renamed files as having no problems. (diff)
downloadandroid_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.tar
android_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.tar.gz
android_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.tar.bz2
android_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.tar.lz
android_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.tar.xz
android_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.tar.zst
android_bootable_recovery-c224ac28adf1248dcd5716a0c6ed77825418fe0d.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));