X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/c980db5f083583cfa95a08d1bf3471762ec85cd9..20c7d7fd698d4cb705aef04fabd20432c7e38580:/hlink.c diff --git a/hlink.c b/hlink.c index f0ce5e4c..962261c7 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); } @@ -202,7 +196,7 @@ void match_hard_links(struct file_list *flist) } static int maybe_hard_link(struct file_struct *file, int ndx, - const char *fname, int statret, statx *sxp, + const char *fname, int statret, stat_x *sxp, const char *oldname, STRUCT_STAT *old_stp, const char *realname, int itemizing, enum logcode code) { @@ -263,7 +257,7 @@ static char *check_prior(int prev_ndx, int gnum, struct file_list **flist_p) /* Only called if FLAG_HLINKED is set and FLAG_HLINK_FIRST is not. Returns: * 0 = process the file, 1 = skip the file, -1 = error occurred. */ int hard_link_check(struct file_struct *file, int ndx, const char *fname, - int statret, statx *sxp, int itemizing, + int statret, stat_x *sxp, int itemizing, enum logcode code) { STRUCT_STAT prev_st; @@ -331,7 +325,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, 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]; - statx alt_sx; + stat_x alt_sx; int j = 0; #ifdef SUPPORT_ACLS alt_sx.acc_acl = alt_sx.def_acl = NULL; @@ -345,7 +339,8 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, || prev_st.st_ino != alt_sx.st.st_ino) continue; statret = 1; - if (verbose < 2 || !stdout_format_has_i) { + if (stdout_format_has_i == 0 + || (verbose < 2 && stdout_format_has_i < 2)) { itemizing = 0; code = FNONE; if (verbose > 1 && maybe_ATTRS_REPORT) @@ -413,7 +408,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx, STRUCT_STAT *stp, int itemizing, enum logcode code, int alt_dest) { - statx prev_sx; + stat_x prev_sx; STRUCT_STAT st; char alt_name[MAXPATHLEN], *prev_name; const char *our_name;