Commit 9d19f8a5 authored by Wayne Davison's avatar Wayne Davison

When rsync encountered an empty file list, it behaved differently

when pulling files than when pushing files:  pulling it output a
(mostly) unhelpful error message and then exited with a 0 status,
even when the remote side exited with an error code.  I changed this
to output the normal end summary (when verbose) and to exit with the
status intact (just like when pushing files).
parent 24e61cff
......@@ -163,7 +163,9 @@ static void handle_stats(int f)
/* this is the client */
if (!am_sender) {
if (f < 0 && !am_sender) /* e.g. when we got an empty file list. */
;
else if (!am_sender) {
/* Read the first two in opposite order because the meaning of
* read/write swaps when switching from sender to receiver. */
total_written = read_longint(f);
......@@ -808,17 +810,16 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
if (write_batch && !am_server)
start_write_batch(f_in);
flist = recv_file_list(f_in);
if (!flist || flist->count == 0) {
rprintf(FINFO, "client: nothing to do: "
"perhaps you need to specify some filenames or "
"the --recursive option?\n");
exit_cleanup(0);
}
the_file_list = flist;
local_name = get_local_name(flist,argv[0]);
if (flist && flist->count > 0) {
local_name = get_local_name(flist, argv[0]);
status2 = do_recv(f_in,f_out,flist,local_name);
status2 = do_recv(f_in, f_out, flist, local_name);
} else {
handle_stats(-1);
output_summary();
}
if (pid != -1) {
if (verbose > 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment