diff options
| author | Wayne Davison <wayned@samba.org> | 2005-04-23 22:30:08 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2005-04-23 22:30:08 +0000 |
| commit | 9d19f8a5feb465e75351edd9057c995e4b56d33e (patch) | |
| tree | 8674166a17d55a5abb849a109ece40de505694e0 /main.c | |
| parent | 24e61cffe3cedc0165ceb623aefb42a35bd7da73 (diff) | |
| download | android_external_rsync-9d19f8a5feb465e75351edd9057c995e4b56d33e.tar.gz android_external_rsync-9d19f8a5feb465e75351edd9057c995e4b56d33e.tar.bz2 android_external_rsync-9d19f8a5feb465e75351edd9057c995e4b56d33e.zip | |
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).
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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) |
