/* -x only affects dirs because we need to avoid recursing
* into a mount-point directory, not to avoid copying a
* symlinked file if -L (or similar) was specified. */
- if (one_file_system && flags & FLAG_CONTENT_DIR) {
- if (flags & FLAG_TOP_DIR)
- filesystem_dev = st.st_dev;
- else if (st.st_dev != filesystem_dev) {
- if (one_file_system > 1) {
- if (verbose > 1) {
- rprintf(FINFO,
- "[%s] skipping mount-point dir %s\n",
- who_am_i(), thisname);
- }
- return NULL;
+ if (one_file_system && st.st_dev != filesystem_dev
+ && BITS_SETnUNSET(flags, FLAG_CONTENT_DIR, FLAG_TOP_DIR)) {
+ if (one_file_system > 1) {
+ if (verbose > 1) {
+ rprintf(FINFO,
+ "[%s] skipping mount-point dir %s\n",
+ who_am_i(), thisname);
}
- flags |= FLAG_MOUNT_DIR;
+ return NULL;
}
+ flags |= FLAG_MOUNT_DIR;
+ flags &= ~FLAG_CONTENT_DIR;
}
} else
flags &= ~FLAG_CONTENT_DIR;
change_local_filter_dir(fbuf, dlen, send_dir_depth);
- if (BITS_SETnUNSET(file->flags, FLAG_CONTENT_DIR, FLAG_MOUNT_DIR))
+ if (file->flags & FLAG_CONTENT_DIR) {
+ if (one_file_system) {
+ STRUCT_STAT st;
+ if (link_stat(fbuf, &st, copy_dirlinks) != 0) {
+ io_error |= IOERR_GENERAL;
+ rsyserr(FERROR, errno, "link_stat %s failed",
+ full_fname(fbuf));
+ return;
+ }
+ filesystem_dev = st.st_dev;
+ }
send_directory(f, flist, fbuf, dlen, flags);
+ }
if (!relative_paths)
return;
send_implied_dirs(f, flist, fbuf, slash, p, flags, 0);
}
+ if (one_file_system)
+ filesystem_dev = st.st_dev;
+
if (recurse || (xfer_dirs && is_dot_dir)) {
struct file_struct *file;
int top_flags = FLAG_TOP_DIR | FLAG_CONTENT_DIR | flags;