diff options
| author | Wayne Davison <wayned@samba.org> | 2004-02-23 07:03:03 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2004-02-23 07:03:03 +0000 |
| commit | 9d78ed31a7a384406bb45ad704842c9a22642685 (patch) | |
| tree | 975dce0fe9527459dfe4715b96ea946e7e54be20 /backup.c | |
| parent | 89afe532d7fbc50a07696c3c49dd2746d0520457 (diff) | |
| download | android_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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)); } |
