sum->flength = len;
sum->blength = blength;
sum->s2length = s2length;
- sum->count = (len + (blength - 1)) / blength;
- sum->remainder = (len % blength);
+ sum->remainder = len % blength;
+ sum->count = len / blength + (sum->remainder != 0);
if (sum->count && verbose > 2) {
rprintf(FINFO,
return;
}
+ if (preserve_hard_links && file->link_u.links
+ && hard_link_check(file, ndx, fname, statret, &st,
+ itemizing, code, HL_CHECK_MASTER))
+ return;
+
if (preserve_links && S_ISLNK(file->mode)) {
#ifdef SUPPORT_LINKS
if (safe_symlinks && unsafe_symlink(file->u.link, fname)) {
}
set_perms(fname, file, &st,
maybe_PERMS_REPORT);
+ if (preserve_hard_links
+ && file->link_u.links) {
+ hard_link_cluster(file, ndx,
+ itemizing,
+ code);
+ }
return;
}
}
if (!S_ISLNK(st.st_mode))
statret = -1;
}
+ if (preserve_hard_links && file->link_u.links
+ && hard_link_check(file, ndx, fname, -1, &st,
+ itemizing, code, HL_SKIP))
+ return;
if (do_symlink(file->u.link,fname) != 0) {
rsyserr(FERROR, errno, "symlink %s -> \"%s\" failed",
full_fname(fname), safe_fname(file->u.link));
SIVAL(numbuf, 0, ndx);
send_msg(MSG_SUCCESS, numbuf, 4);
}
+ if (preserve_hard_links && file->link_u.links)
+ hard_link_cluster(file, ndx, itemizing, code);
}
#endif
return;
}
if (am_root && preserve_devices && IS_DEVICE(file->mode)) {
- if (statret != 0 ||
- st.st_mode != file->mode ||
- st.st_rdev != file->u.rdev) {
+ if (statret != 0
+ || (st.st_mode & ~CHMOD_BITS) != (file->mode & ~CHMOD_BITS)
+ || st.st_rdev != file->u.rdev) {
if (delete_item(fname, st.st_mode, DEL_TERSE) < 0)
return;
+ if (preserve_hard_links && file->link_u.links
+ && hard_link_check(file, ndx, fname, -1, &st,
+ itemizing, code, HL_SKIP))
+ return;
if (!IS_DEVICE(st.st_mode))
statret = -1;
if (verbose > 2) {
rprintf(code, "%s\n",
safe_fname(fname));
}
+ if (preserve_hard_links && file->link_u.links) {
+ hard_link_cluster(file, ndx,
+ itemizing, code);
+ }
}
} else {
if (itemizing)
itemize(file, ndx, statret, &st, 0, 0, NULL);
set_perms(fname, file, &st, maybe_PERMS_REPORT);
+ if (preserve_hard_links && file->link_u.links)
+ hard_link_cluster(file, ndx, itemizing, code);
}
return;
}
- if (preserve_hard_links
- && hard_link_check(file, ndx, fname, statret, &st,
- itemizing, code, HL_CHECK_MASTER))
- return;
-
if (!S_ISREG(file->mode)) {
if (the_file_list->count == 1)
fname = f_name(file);
}
if (statret != 0) {
- if (preserve_hard_links
+ if (preserve_hard_links && file->link_u.links
&& hard_link_check(file, ndx, fname, statret, &st,
itemizing, code, HL_SKIP))
return;
full_fname(fnamecmp));
pretend_missing:
/* pretend the file didn't exist */
- if (preserve_hard_links
+ if (preserve_hard_links && file->link_u.links
&& hard_link_check(file, ndx, fname, statret, &st,
itemizing, code, HL_SKIP))
return;