X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/fd4893155d5226d32f350d15cc3e29beec677f39..3d061653890e25fd95186d521a2d1dc5ea4d76e7:/backup.c diff --git a/backup.c b/backup.c index 56e26e10..43bba13b 100644 --- a/backup.c +++ b/backup.c @@ -130,8 +130,8 @@ failure: /* robustly move a file, creating new directory structures if necessary */ static int robust_move(char *src, char *dst) { - if (robust_rename(src, dst, 0755) != 0 && (errno != ENOENT - || make_bak_dir(dst) < 0 || robust_rename(src, dst, 0755) != 0)) + if (robust_rename(src, dst, 0755) < 0 && (errno != ENOENT + || make_bak_dir(dst) < 0 || robust_rename(src, dst, 0755) < 0)) return -1; return 0; }