X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1aa343e89c8ac63b71cff36001cbaa8ed00b11d2..3f0211b63a6cdc4a2cecfd2a0dffeba172c86a47:/hlink.c diff --git a/hlink.c b/hlink.c index 2392ecdb..1bc23d11 100644 --- a/hlink.c +++ b/hlink.c @@ -34,11 +34,9 @@ extern int protocol_version; extern int remove_source_files; extern int stdout_format_has_i; extern int maybe_ATTRS_REPORT; +extern int unsort_ndx; extern char *basis_dir[]; extern struct file_list *cur_flist; -#ifdef ICONV_OPTION -extern int ic_ndx; -#endif #ifdef SUPPORT_HARD_LINKS @@ -145,11 +143,9 @@ static void match_gnums(int32 *ndx_list, int ndx_count) break; F_HL_PREV(file) = prev; /* The linked list must use raw ndx values. */ -#ifdef ICONV_OPTION - if (ic_ndx) + if (unsort_ndx) prev = F_NDX(file); else -#endif prev = ndx_list[from] + hlink_flist->ndx_start; } if (prev < 0 && !inc_recurse) { @@ -163,11 +159,9 @@ static void match_gnums(int32 *ndx_list, int ndx_count) file->flags |= FLAG_HLINK_LAST; F_HL_PREV(file) = prev; if (inc_recurse && CVAL(node->data, 0) == 0) { -#ifdef ICONV_OPTION - if (ic_ndx) + if (unsort_ndx) prev = F_NDX(file); else -#endif prev = ndx_list[from] + hlink_flist->ndx_start; SIVAL(node->data, 1, prev); } @@ -223,7 +217,7 @@ static int maybe_hard_link(struct file_struct *file, int ndx, if (!make_backup(fname)) return -1; } else if (robust_unlink(fname)) { - rsyserr(FERROR, errno, "unlink %s failed", + rsyserr(FERROR_XFER, errno, "unlink %s failed", full_fname(fname)); return -1; } @@ -323,7 +317,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, } if (link_stat(prev_name, &prev_st, 0) < 0) { - rsyserr(FERROR, errno, "stat %s failed", + rsyserr(FERROR_XFER, errno, "stat %s failed", full_fname(prev_name)); return -1; } @@ -399,7 +393,7 @@ int hard_link_one(struct file_struct *file, const char *fname, return -1; code = FINFO; } else - code = FERROR; + code = FERROR_XFER; rsyserr(code, errno, "link %s => %s failed", full_fname(fname), oldname); return 0; @@ -423,7 +417,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx, if (stp == NULL && prev_ndx >= 0) { if (link_stat(fname, &st, 0) < 0) { - rsyserr(FERROR, errno, "stat %s failed", + rsyserr(FERROR_XFER, errno, "stat %s failed", full_fname(fname)); return; }