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

Function check_for_finished_files

generator.c:2148–2241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2146}
2147
2148void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
2149{
2150 struct file_struct *file;
2151 struct file_list *flist;
2152 char fbuf[MAXPATHLEN];
2153 int ndx;
2154
2155 while (1) {
2156#ifdef SUPPORT_HARD_LINKS
2157 if (preserve_hard_links && (ndx = get_hlink_num()) != -1) {
2158 int send_failed = (ndx == -2);
2159 if (send_failed)
2160 ndx = get_hlink_num();
2161 flist = flist_for_ndx(ndx, "check_for_finished_files.1");
2162 if (ndx < flist->ndx_start)
2163 exit_cleanup(RERR_PROTOCOL);
2164 file = flist->files[ndx - flist->ndx_start];
2165 assert(file->flags & FLAG_HLINKED);
2166 if (send_failed)
2167 handle_skipped_hlink(file, itemizing, code, sock_f_out);
2168 else
2169 finish_hard_link(file, f_name(file, fbuf), ndx, NULL, itemizing, code, -1);
2170 flist->in_progress--;
2171 continue;
2172 }
2173#endif
2174
2175 if (check_redo && (ndx = get_redo_num()) != -1) {
2176 OFF_T save_max_size = max_size;
2177 OFF_T save_min_size = min_size;
2178 csum_length = SUM_LENGTH;
2179 max_size = -1;
2180 min_size = -1;
2181 ignore_existing = -ignore_existing;
2182 ignore_non_existing = -ignore_non_existing;
2183 update_only = -update_only;
2184 always_checksum = -always_checksum;
2185 size_only = -size_only;
2186 append_mode = -append_mode;
2187 make_backups = -make_backups; /* avoid dup backup w/inplace */
2188 ignore_times++;
2189
2190 flist = cur_flist;
2191 cur_flist = flist_for_ndx(ndx, "check_for_finished_files.2");
2192 if (ndx < cur_flist->ndx_start)
2193 exit_cleanup(RERR_PROTOCOL);
2194
2195 file = cur_flist->files[ndx - cur_flist->ndx_start];
2196 if (solo_file)
2197 strlcpy(fbuf, solo_file, sizeof fbuf);
2198 else
2199 f_name(file, fbuf);
2200 recv_generator(fbuf, file, ndx, itemizing, code, sock_f_out);
2201 cur_flist->to_redo--;
2202
2203 cur_flist = flist;
2204
2205 csum_length = SHORT_SUM_LENGTH;

Callers 2

increment_active_filesFunction · 0.85
generate_filesFunction · 0.85

Calls 12

get_hlink_numFunction · 0.85
flist_for_ndxFunction · 0.85
handle_skipped_hlinkFunction · 0.85
finish_hard_linkFunction · 0.85
f_nameFunction · 0.85
get_redo_numFunction · 0.85
strlcpyFunction · 0.85
recv_generatorFunction · 0.85
write_ndxFunction · 0.85
maybe_flush_socketFunction · 0.85
touch_up_dirsFunction · 0.85
flist_freeFunction · 0.85

Tested by

no test coverage detected