X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9d78ed31a7a384406bb45ad704842c9a22642685..ac1d2d338450eb005abf03002f5784097caf7e19:/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; }