- if (robust_unlink(f_name(&hlink_list[i])) != 0 ||
- do_link(f_name(&hlink_list[i - 1]),
- f_name(&hlink_list[i])) != 0) {
- if (verbose > 0)
- rprintf(FINFO, "link %s => %s : %s\n",
- f_name(&hlink_list[i]),
- f_name(&hlink_list[i - 1]),
- strerror(errno));
- return;
- }
+ if (link_stat(prev_name, &prev_st, 0) < 0) {
+ rsyserr(FERROR, errno, "stat %s failed",
+ full_fname(prev_name));
+ return -1;
+ }
+
+ if (statret < 0 && basis_dir[0] != NULL) {
+ /* If we match an alt-dest item, we don't output this as a change. */
+ char cmpbuf[MAXPATHLEN];
+ STRUCT_STAT alt_st;
+ int j = 0;
+ do {
+ pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
+ if (link_stat(cmpbuf, &alt_st, 0) < 0)
+ continue;
+ if (link_dest) {
+ if (prev_st.st_dev != alt_st.st_dev
+ || prev_st.st_ino != alt_st.st_ino)
+ continue;
+ statret = 1;
+ *stp = alt_st;
+ if (verbose < 2 || !stdout_format_has_i) {
+ itemizing = 0;
+ code = FNONE;
+ if (verbose > 1 && maybe_ATTRS_REPORT)
+ rprintf(FCLIENT, "%s is uptodate\n", fname);
+ }
+ break;
+ }
+ if (!unchanged_file(cmpbuf, file, &alt_st))
+ continue;
+ statret = 1;
+ *stp = alt_st;
+ if (unchanged_attrs(file, &alt_st))
+ break;
+ } while (basis_dir[++j] != NULL);