diff options
Diffstat (limited to 'updater')
-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 95c8c1111..17ea4c2b5 100644 --- a/updater/install.c +++ b/updater/install.c @@ -378,6 +378,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)); |