diff options
author | Michael Runge <mrunge@google.com> | 2014-10-23 18:34:38 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-23 18:34:38 +0200 |
commit | 3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc (patch) | |
tree | f3f047ecc65ab48c1c7f49d5cef784936292e1b1 | |
parent | init.rc: Inidicate that booting is complete wrt firwmare requests (diff) | |
parent | Treat already-renamed files as having no problems. (diff) | |
download | android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.tar android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.tar.gz android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.tar.bz2 android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.tar.lz android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.tar.xz android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.tar.zst android_bootable_recovery-3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc.zip |
-rw-r--r-- | updater/install.c | 3 |
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)); |