Hi,
I think I've found the cause of the spurious error exit status that has been
plaguing me for some time, as I mentioned in a previous message
http://rsync.samba.org/listproc/rsync/March2000/0125.html
Rsync frequently gives exit status 20 even though the transfer was correct.
This caused problems as the controlling script could not distinguish this
from a network problem.
The problem seems to be that (in protocol versions >= 24) the receiver sends
a "final goodbye message" (just (int)-1), but this is only read by the
sender if it is the client. This means that, when receiving files from a
remote machine, the server process exits without reading this final word. If
the server happens to exit before the client, then the client gets a "broken
pipe" signal, which causes it to stop with status 20. For me, this seems to
happen with large transfers (I can reliably get the exit status 20 with a
dry run listing ~2000 files).
I attach a fix to this problem. Does this look reasonable?
Tim.
PS. I am using rsync-2.4.3 over ssh between various (mainly) Solaris 2.6
machines between the US and Europe.
============================== cut here ==============================
Tim Adye, BaBar/DELPHI Groups, Particle Physics Dept., _ /|
Rutherford Appleton Laboratory, UK. \'o.O' Oop!
e-mail: [EMAIL PROTECTED] or VXCERN::ADYE (HEPNET/SPAN) =(___)= Ack!
WWW: http://hepwww.rl.ac.uk/Delphi/Adye/homepage.html U Thphft!
diff -c rsync-2.4.3/main.c rsync-2.4.3-tja4/main.c
*** rsync-2.4.3/main.c Sun Apr 9 03:53:30 2000
--- rsync-2.4.3-tja4/main.c Tue Jul 25 17:51:50 2000
***************
*** 236,241 ****
--- 236,242 ----
char *dir = argv[0];
extern int relative_paths;
extern int recurse;
+ extern int remote_version;
if (verbose > 2)
rprintf(FINFO,"server_sender starting pid=%d\n",(int)getpid());
***************
*** 269,274 ****
--- 270,279 ----
send_files(flist,f_out,f_in);
report(f_out);
io_flush();
+ if (remote_version >= 24) {
+ /* final goodbye message */
+ read_int(f_in);
+ }
exit_cleanup(0);
}