aboutsummaryrefslogtreecommitdiffstats
path: root/backup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-02-23 07:03:03 +0000
committerWayne Davison <wayned@samba.org>2004-02-23 07:03:03 +0000
commit9d78ed31a7a384406bb45ad704842c9a22642685 (patch)
tree975dce0fe9527459dfe4715b96ea946e7e54be20 /backup.c
parent89afe532d7fbc50a07696c3c49dd2746d0520457 (diff)
downloadandroid_external_rsync-9d78ed31a7a384406bb45ad704842c9a22642685.tar.gz
android_external_rsync-9d78ed31a7a384406bb45ad704842c9a22642685.tar.bz2
android_external_rsync-9d78ed31a7a384406bb45ad704842c9a22642685.zip
A couple fixes from Shinichi Maruyama.
Diffstat (limited to 'backup.c')
-rw-r--r--backup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/backup.c b/backup.c
index 2078861b..56e26e10 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;
}
@@ -224,7 +224,7 @@ static int keep_backup(char *fname)
/* move to keep tree if a file */
if (!kept) {
- if (!robust_move(fname, backup_dir_buf)) {
+ if (robust_move(fname, backup_dir_buf) != 0) {
rprintf(FERROR, "keep_backup failed: %s -> \"%s\": %s\n",
full_fname(fname), backup_dir_buf, strerror(errno));
}