Avoid an dry-run error trying to stat a prior hard-link

file that hasn't really been created.
This commit is contained in:
Wayne Davison committed 2009-09-05 08:18:35 -07:00
1 parent 2c1aa2efac
commit b15fa9bd7b
1 file changed
+7 -3
+7 -3
View File
@@ -377,9 +377,13 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
}
if (link_stat(prev_name, &prev_st, 0) < 0) {
rsyserr(FERROR_XFER, errno, "stat %s failed",
full_fname(prev_name));
return -1;
if (!dry_run || errno != ENOENT) {
rsyserr(FERROR_XFER, errno, "stat %s failed", full_fname(prev_name));
return -1;
}
/* A new hard-link will get a new dev & inode, so approximate
* those values in dry-run mode by zeroing them. */
memset(&prev_st, 0, sizeof prev_st);
}
if (statret < 0 && basis_dir[0] != NULL) {