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

Function flist_for_ndx

rsync.c:787–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785}
786
787struct file_list *flist_for_ndx(int ndx, const char *fatal_error_loc)
788{
789 struct file_list *flist = cur_flist;
790
791 if (!flist && !(flist = first_flist))
792 goto not_found;
793
794 while (ndx < flist->ndx_start-1) {
795 if (flist == first_flist)
796 goto not_found;
797 flist = flist->prev;
798 }
799 while (ndx >= flist->ndx_start + flist->used) {
800 if (!(flist = flist->next))
801 goto not_found;
802 }
803 return flist;
804
805 not_found:
806 if (fatal_error_loc) {
807 int first, last;
808 if (first_flist) {
809 first = first_flist->ndx_start - 1;
810 last = first_flist->prev->ndx_start + first_flist->prev->used - 1;
811 } else {
812 first = 0;
813 last = -1;
814 }
815 rprintf(FERROR,
816 "File-list index %d not in %d - %d (%s) [%s]\n",
817 ndx, first, last, fatal_error_loc, who_am_i());
818 exit_cleanup(RERR_PROTOCOL);
819 }
820 return NULL;
821}
822
823const char *who_am_i(void)
824{

Callers 8

successful_sendFunction · 0.85
match_gnumsFunction · 0.85
check_priorFunction · 0.85
finish_hard_linkFunction · 0.85
got_flist_entry_statusFunction · 0.85
read_ndx_and_attrsFunction · 0.85
check_for_finished_filesFunction · 0.85
no_batched_updateFunction · 0.85

Calls 2

rprintfFunction · 0.70
who_am_iFunction · 0.70

Tested by

no test coverage detected