MCPcopy Create free account
hub / github.com/RsyncProject/rsync / fsort

Function fsort

flist.c:1783–1795  ·  view source on GitHub ↗

This file-struct sorting routine makes sure that any identical names in * the file list stay in the same order as they were in the original list. * This is particularly vital in inc_recurse mode where we expect a sort * on the flist to match the exact order of a sort on the dir_flist. */

Source from the content-addressed store, hash-verified

1781 * This is particularly vital in inc_recurse mode where we expect a sort
1782 * on the flist to match the exact order of a sort on the dir_flist. */
1783static void fsort(struct file_struct **fp, size_t num)
1784{
1785 if (num <= 1)
1786 return;
1787
1788 if (use_qsort)
1789 qsort(fp, num, PTR_SIZE, file_compare);
1790 else {
1791 struct file_struct **tmp = new_array(struct file_struct *, (num+1) / 2);
1792 fsort_tmp(fp, num, tmp);
1793 free(tmp);
1794 }
1795}
1796
1797/* We take an entire set of sibling dirs from the sorted flist and link them
1798 * into the tree, setting the appropriate parent/child/sibling pointers. */

Callers 2

recv_file_listFunction · 0.85
flist_sort_and_cleanFunction · 0.85

Calls 1

fsort_tmpFunction · 0.85

Tested by

no test coverage detected