* Moved call to NmbLookupFindHostCmd in BackupPC_dump to after the
[BackupPC.git] / lib / BackupPC / Xfer / RsyncFileIO.pm
index b3e6e92..bf52653 100644 (file)
@@ -12,7 +12,7 @@
 #
 #========================================================================
 #
-# Version 3.1.0, released 25 Nov 2007.
+# Version 3.2.0, released 31 Dec 2008.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -162,6 +162,12 @@ sub csumStart
                                      $defBlkSize, $fio->{checksumSeed},
                                      0, $attr->{compress}, 0,
                                      $fio->{protocol_version});
+        if ( $err ) {
+            $fio->log("Can't get rsync digests from $attr->{fullPath}"
+                    . " (err=$err, name=$f->{name})");
+            $fio->{stats}{errorCnt}++;
+            return -1;
+        }
         my($isCached, $isInvalid) = $d->isCached;
         if ( $fio->{logLevel} >= 5 ) {
             $fio->log("$attr->{fullPath} verify; cached = $isCached,"
@@ -596,7 +602,10 @@ sub processClose
     my($exists, $digest, $outSize, $errs) = $poolWrite->close;
 
     $fileName =~ s{^/+}{};
-    $fio->log(@$errs) if ( defined($errs) && @$errs );
+    if ( defined($errs) && @$errs ) {
+        $fio->log(@$errs);
+        $fio->{stats}{errorCnt} += @$errs;
+    }
     if ( $doStats ) {
        $fio->{stats}{TotalFileCnt}++;
        $fio->{stats}{TotalFileSize} += $origSize;
@@ -638,7 +647,7 @@ sub makePath
     $fio->logFileAction("create", $f) if ( $fio->{logLevel} >= 1 );
     $fio->log("makePath($path, 0777)") if ( $fio->{logLevel} >= 5 );
     $path = $1 if ( $path =~ /(.*)/s );
-    File::Path::mkpath($path, 0, 0777) if ( !-d $path );
+    eval { File::Path::mkpath($path, 0, 0777) } if ( !-d $path );
     return $fio->attribSet($f) if ( -d $path );
     $fio->log("Can't create directory $path");
     $fio->{stats}{errorCnt}++;