X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9459290ae798f52b34c569045af8b8655c31308e..bb6721dce6bac8ff2374609bf5f99ea7e6fe2c70:/main.c diff --git a/main.c b/main.c index fb0924a1..1f2cee36 100644 --- a/main.c +++ b/main.c @@ -43,6 +43,7 @@ extern int local_server; extern int log_got_error; extern int module_id; extern int orig_umask; +extern int copy_links; extern int keep_dirlinks; extern int preserve_hard_links; extern int protocol_version; @@ -177,15 +178,15 @@ static void report(int f) rprintf(FINFO,"Matched data: %.0f bytes\n", (double)stats.matched_data); rprintf(FINFO,"File list size: %d\n", stats.flist_size); - rprintf(FINFO,"Total bytes written: %.0f\n", + rprintf(FINFO,"Total bytes sent: %.0f\n", (double)total_written); - rprintf(FINFO,"Total bytes read: %.0f\n", + rprintf(FINFO,"Total bytes received: %.0f\n", (double)total_read); } if (verbose || do_stats) { rprintf(FINFO, - "\nwrote %.0f bytes read %.0f bytes %.2f bytes/sec\n", + "\nsent %.0f bytes received %.0f bytes %.2f bytes/sec\n", (double)total_written, (double)total_read, (total_written + total_read)/(0.5 + (t - starttime))); rprintf(FINFO, "total size is %.0f speedup is %.2f\n", @@ -458,6 +459,10 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) int status = 0; int error_pipe[2]; + /* The receiving side mustn't obey this, or an existing symlink that + * points to an identical file won't be replaced by the referent. */ + copy_links = 0; + if (preserve_hard_links) init_hard_links(flist); @@ -480,7 +485,7 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) close(f_out); /* we can't let two processes write to the socket at one time */ - io_multiplexing_close(); + close_multiplexing_out(); /* set place to send errors */ set_msg_fd_out(error_pipe[1]); @@ -499,6 +504,7 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) } am_generator = 1; + close_multiplexing_in(); if (write_batch) stop_write_batch();