+ if (!remove_source_files)
+ return;
+
+ if (!(flist = flist_for_ndx(ndx))) {
+ rprintf(FERROR,
+ "INTERNAL ERROR: unable to find flist for item %d\n",
+ ndx);
+ return;
+ }
+
+ file = flist->files[ndx - flist->ndx_start];
+ if (!push_flist_dir(F_ROOTDIR(file), -1))
+ return;
+ f_name(file, fname);
+
+ if (do_unlink(fname) == 0) {
+ if (verbose > 1)
+ rprintf(FINFO, "sender removed %s\n", fname);
+ } else
+ rsyserr(FERROR, errno, "sender failed to remove %s", fname);
+}
+
+void write_ndx_and_attrs(int f_out, int ndx, int iflags,
+ uchar fnamecmp_type, char *buf, int len)
+{
+ write_ndx(f_out, ndx);
+ if (protocol_version < 29)
+ return;
+ write_shortint(f_out, iflags);
+ if (iflags & ITEM_BASIS_TYPE_FOLLOWS)
+ write_byte(f_out, fnamecmp_type);
+ if (iflags & ITEM_XNAME_FOLLOWS)
+ write_vstring(f_out, buf, len);
+}