diff options
author | Wayne Davison <wayned@samba.org> | 2007-11-29 10:27:16 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2007-11-29 10:27:16 -0800 |
commit | eb67a6909b02a333b36abf8ad11304863eb22e19 (patch) | |
tree | ce36d0200de160b890ffd90741414b4f48052f85 | |
parent | 9217ce30e308db28dc4789ef009ecf553f35097c (diff) | |
download | rsync-eb67a6909b02a333b36abf8ad11304863eb22e19.tar.gz rsync-eb67a6909b02a333b36abf8ad11304863eb22e19.tar.bz2 rsync-eb67a6909b02a333b36abf8ad11304863eb22e19.zip |
Don't try to process hard-link data in list-only mode.
-rw-r--r-- | hlink.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -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(); } |