X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/3f0211b63a6cdc4a2cecfd2a0dffeba172c86a47..b58f5e17ed35c68e10b88869d1e10d5378bd40e0:/hlink.c diff --git a/hlink.c b/hlink.c index 1bc23d11..dfd00681 100644 --- a/hlink.c +++ b/hlink.c @@ -24,6 +24,7 @@ extern int verbose; extern int dry_run; +extern int list_only; extern int am_sender; extern int inc_recurse; extern int do_xfers; @@ -174,23 +175,25 @@ static void match_gnums(int32 *ndx_list, int ndx_count) * to first when we're done. */ void match_hard_links(struct file_list *flist) { - int i, ndx_count = 0; - int32 *ndx_list; + if (!list_only) { + int i, ndx_count = 0; + int32 *ndx_list; - if (!(ndx_list = new_array(int32, flist->used))) - out_of_memory("match_hard_links"); + if (!(ndx_list = new_array(int32, flist->used))) + out_of_memory("match_hard_links"); - for (i = 0; i < flist->used; i++) { - if (F_IS_HLINKED(flist->sorted[i])) - ndx_list[ndx_count++] = i; - } + for (i = 0; i < flist->used; i++) { + if (F_IS_HLINKED(flist->sorted[i])) + ndx_list[ndx_count++] = i; + } - hlink_flist = flist; + hlink_flist = flist; - if (ndx_count) - match_gnums(ndx_list, ndx_count); + if (ndx_count) + match_gnums(ndx_list, ndx_count); - free(ndx_list); + free(ndx_list); + } if (protocol_version < 30) idev_destroy(); }