+ &$Log(sprintf("digestAdd: $file has unexpected first char 0x%x",
+ ord($data)));
+ return -105;
+ }
+ return -106 if ( sysseek($fh2, $eofPosn, 0) != $eofPosn );
+ if ( $verify ) {
+ my $data3;
+
+ #
+ # Verify the cached checksums
+ #
+ return -107 if ( $data ne chr(0xd6) );
+ return -108 if ( sysread($fh2, $data3, length($data2) + 1) < 0 );
+ if ( $data2 eq $data3 ) {
+ return 1;
+ }
+ #
+ # Checksums don't agree - fall through so we rewrite the data
+ #
+ &$Log(sprintf("digestAdd: %s verify failed; redoing checksums; len = %d,%d; eofPosn = %d, fileSize = %d",
+ $file, length($data2), length($data3), $eofPosn, $fileSize));
+ #&$Log(sprintf("dataNew = %s", unpack("H*", $data2)));
+ #&$Log(sprintf("dataFile = %s", unpack("H*", $data3)));
+ return -109 if ( sysseek($fh2, $eofPosn, 0) != $eofPosn );
+ $retValue = 2;
+ return $retValue if ( $verify == 2 );