--- RsyncP.pm.orig 2009-07-27 01:10:47.000000000 +0200 +++ RsyncP.pm 2009-07-27 01:56:55.000000000 +0200 @@ -537,6 +537,7 @@ $rs->writeData(pack("V", 0xffffffff), 1); $rs->{fio}->finish(1); $rs->log("Child is aborting") if ( $rs->{abort} ); + print(WH "fatal $rs->{fatalErrorMsg}\n") if ( $rs->{fatalError} ); print(WH "exit\n"); exit(0); } @@ -944,7 +945,7 @@ } # -# See if there are any messges from the local child over the pipe. +# See if there are any messages from the local child over the pipe. # These could be logging messages or requests to repeat files. # sub pollChild @@ -1003,6 +1004,18 @@ if ( $rs->{logLevel} >= 4 ); $rs->{stats}{childStats} = \%childStats; $rs->{stats}{parentStats} = $rs->{fio}->statsGet; + } elsif ( $mesg =~ /^fatal / ) { + $rs->{fatalError} = 1; + if ( defined $rs->{fatalErrorMsg} ) { + $rs->{fatalErrorMsg} .= ' / Child: ' . substr($mesg,6); + } else { + $rs->{fatalErrorMsg} = substr($mesg,6); + } + $rs->log("Got fatal error from child: $rs->{fatalErrorMsg}") + if ( $rs->{logLevel} >= 1 ); + # this should really be limited to logLevel >= 4, but for + # for testing I'll put it in "unconditionally" - we want to + # notice if this goes astray ... } elsif ( $mesg =~ /^exit/ ) { $rs->log("Got exit from child") if ( $rs->{logLevel} >= 4 ); $rs->{childDone} = 3;