extern int inc_recurse;
extern int inplace;
extern int flist_eof;
+extern int file_old_total;
extern int msgs2stderr;
extern int keep_dirlinks;
extern int make_backups;
goto read_loop;
}
- cur_flist = flist_for_ndx(ndx, "read_ndx_and_attrs");
+ flist = flist_for_ndx(ndx, "read_ndx_and_attrs");
+ if (flist != cur_flist) {
+ cur_flist = flist;
+ if (am_sender) {
+ file_old_total = cur_flist->used;
+ for (flist = first_flist; flist != cur_flist; flist = flist->next)
+ file_old_total += flist->used;
+ }
+ }
if (iflags & ITEM_BASIS_TYPE_FOLLOWS)
fnamecmp_type = read_byte(f_in);
flags |= ATTRS_SKIP_MTIME;
if (!(flags & ATTRS_SKIP_MTIME)
&& cmp_time(sxp->st.st_mtime, file->modtime) != 0) {
- int ret = set_modtime(fname, file->modtime, sxp->st.st_mode);
+ int ret = set_modtime(fname, file->modtime, F_MOD_NSEC(file), sxp->st.st_mode);
if (ret < 0) {
rsyserr(FERROR_XFER, errno, "failed to set times on %s",
full_fname(fname));
* If set_acl() changes permission bits in the process of setting
* an access ACL, it changes sxp->st.st_mode so we know whether we
* need to chmod(). */
- if (preserve_acls && !S_ISLNK(new_mode) && set_acl(fname, file, sxp) == 0)
- updated = 1;
+ if (preserve_acls && !S_ISLNK(new_mode)) {
+ if (set_acl(fname, file, sxp, new_mode) > 0)
+ updated = 1;
+ }
#endif
#ifdef HAVE_CHMOD