}
#endif
- if (preserve_hard_links && file->link_u.links && file->F_HEAD != file) {
- if (verbose > 1) {
- rprintf(FINFO, "recv_generator: \"%s\" is a hard link\n",
- f_name(file));
- }
+ if (preserve_hard_links && hard_link_check(file, HL_CHECK_MASTER))
return;
- }
if (!S_ISREG(file->mode)) {
rprintf(FINFO, "skipping non-regular file \"%s\"\n",fname);
}
if (statret == -1) {
+ if (preserve_hard_links && hard_link_check(file, HL_SKIP))
+ return;
if (errno == ENOENT) {
write_int(f_out,i);
if (!dry_run) write_sum_head(f_out, NULL);
}
/* now pretend the file didn't exist */
+ if (preserve_hard_links && hard_link_check(file, HL_SKIP))
+ return;
write_int(f_out,i);
if (!dry_run) write_sum_head(f_out, NULL);
return;
rprintf(FERROR, "failed to open %s, continuing: %s\n",
full_fname(fnamecmp), strerror(errno));
/* pretend the file didn't exist */
+ if (preserve_hard_links && hard_link_check(file, HL_SKIP))
+ return;
write_int(f_out,i);
write_sum_head(f_out, NULL);
return;
int phase=0;
char fbuf[MAXPATHLEN];
- if (verbose > 2)
- rprintf(FINFO,"generator starting pid=%d count=%d\n",
- (int)getpid(),flist->count);
+ if (verbose > 2) {
+ rprintf(FINFO, "generator starting pid=%ld count=%d\n",
+ (long)getpid(), flist->count);
+ }
if (verbose >= 2) {
rprintf(FINFO,
rprintf(FINFO,"generate_files phase=%d\n",phase);
write_int(f,-1);
+
+ if (preserve_hard_links)
+ do_hard_links();
+
+ /* now we need to fix any directory permissions that were
+ * modified during the transfer */
+ for (i = 0; i < flist->count; i++) {
+ struct file_struct *file = flist->files[i];
+ if (!file->basename || !S_ISDIR(file->mode)) continue;
+ recv_generator(local_name ? local_name : f_name(file),
+ file, i, -1);
+ }
+
+ if (verbose > 2)
+ rprintf(FINFO,"generate_files finished\n");
}