X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/0679ac4ca9d8fda7fc27dd0d44de48957c0ff88d..d051056f921f465c487a85f9fa29a2324332bc4b:/flist.c diff --git a/flist.c b/flist.c index 5babe91c..56e742c0 100644 --- a/flist.c +++ b/flist.c @@ -28,7 +28,6 @@ #include "rsync.h" extern int verbose; -extern int dry_run; extern int list_only; extern int am_root; extern int am_server; @@ -43,10 +42,10 @@ extern int recurse; extern int xfer_dirs; extern int filesfrom_fd; extern int one_file_system; +extern int copy_dirlinks; extern int keep_dirlinks; extern int preserve_links; extern int preserve_hard_links; -extern int preserve_perms; extern int preserve_devices; extern int preserve_specials; extern int preserve_uid; @@ -58,7 +57,6 @@ extern int copy_links; extern int copy_unsafe_links; extern int protocol_version; extern int sanitize_paths; -extern const char *io_write_phase; extern struct stats stats; extern struct file_list *the_file_list; @@ -174,7 +172,7 @@ static int readlink_stat(const char *path, STRUCT_STAT *buffer, char *linkbuf) #ifdef SUPPORT_LINKS if (copy_links) return do_stat(path, buffer); - if (link_stat(path, buffer, 0) < 0) + if (link_stat(path, buffer, copy_dirlinks) < 0) return -1; if (S_ISLNK(buffer->st_mode)) { int l = readlink((char *)path, linkbuf, MAXPATHLEN - 1); @@ -335,8 +333,6 @@ static void send_file_entry(struct file_struct *file, int f) return; } - io_write_phase = "send_file_entry"; - f_name(file, fname); flags = file->flags & XMIT_TOP_DIR; @@ -488,8 +484,6 @@ static void send_file_entry(struct file_struct *file, int f) } strlcpy(lastname, fname, MAXPATHLEN); - - io_write_phase = "unknown"; } static struct file_struct *receive_file_entry(struct file_list *flist, @@ -1141,7 +1135,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) && (len == 1 || fbuf[len-2] == '/'); } - if (link_stat(fbuf, &st, keep_dirlinks) != 0) { + if (link_stat(fbuf, &st, copy_dirlinks) != 0) { io_error |= IOERR_GENERAL; rsyserr(FERROR, errno, "link_stat %s failed", full_fname(fbuf)); @@ -1256,7 +1250,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) if (fn != p || (*lp && *lp != '/')) { int save_copy_links = copy_links; int save_xfer_dirs = xfer_dirs; - copy_links = copy_unsafe_links; + copy_links |= copy_unsafe_links; xfer_dirs = 1; while ((slash = strchr(slash+1, '/')) != 0) { *slash = '\0'; @@ -1366,7 +1360,7 @@ struct file_list *recv_file_list(int f) flags |= read_byte(f) << 8; file = receive_file_entry(flist, flags, f); - if (S_ISREG(file->mode)) + if (S_ISREG(file->mode) || S_ISLNK(file->mode)) stats.total_size += file->length; flist->files[flist->count++] = file;