--- files/patch-backup__creator.cc (nonexistent) +++ files/patch-backup__creator.cc (working copy) @@ -0,0 +1,29 @@ +--- backup_creator.cc.orig 2016-10-12 01:34:15 UTC ++++ backup_creator.cc +@@ -109,7 +109,7 @@ void BackupCreator::handleMoreData( unsi + + void BackupCreator::saveChunkToSave() + { +- CHECK( chunkToSaveFill > 0, "chunk to save is empty" ); ++ ZBACKUP_CHECK( chunkToSaveFill > 0, "chunk to save is empty" ); + + if ( chunkToSaveFill < 128 ) // TODO: make this value configurable + { +@@ -162,7 +162,7 @@ void BackupCreator::finish() + + // Concatenate the rest of data and save it too + +- CHECK( chunkToSaveFill + ringBufferFill <= chunkMaxSize, "had more than two " ++ ZBACKUP_CHECK( chunkToSaveFill + ringBufferFill <= chunkMaxSize, "had more than two " + "full chunks at backup finish" ); + + moveFromRingBufferToChunkToSave( ringBufferFill ); +@@ -274,7 +274,7 @@ void BackupCreator::outputInstruction( B + + void BackupCreator::getBackupData( string & str ) + { +- CHECK( backupDataStream.get(), "getBackupData() called twice" ); ++ ZBACKUP_CHECK( backupDataStream.get(), "getBackupData() called twice" ); + backupDataStream.reset(); + str.swap( backupData ); + } --- files/patch-check.hh (nonexistent) +++ files/patch-check.hh (working copy) @@ -0,0 +1,35 @@ +--- check.hh.orig 2016-10-12 01:34:15 UTC ++++ check.hh +@@ -10,12 +10,12 @@ + + // Run-time assertion macro + +-// Usage: CHECK( value == 16, "Value is not 16: %d", value ); ++// Usage: ZBACKUP_CHECK( value == 16, "Value is not 16: %d", value ); + // This will abort() if the value is not 16 with the message stating so. + + // TODO: show the backtrace here, without using __FILE__ __LINE__ + +-#define CHECK( condition, message, ... ) ({if (!(condition)) \ ++#define ZBACKUP_CHECK( condition, message, ... ) ({if (!(condition)) \ + { \ + fprintf( stderr, "Check failed: " ); \ + fprintf( stderr, message, ##__VA_ARGS__ ); \ +@@ -23,7 +23,7 @@ + abort(); \ + }}) + +-#define FAIL( ... ) CHECK( false, __VA_ARGS__ ) ++#define FAIL( ... ) ZBACKUP_CHECK( false, __VA_ARGS__ ) + + + // Debug-only versions. Only instantiated in debug builds +@@ -31,7 +31,7 @@ + #define DCHECK CHECK + #define DFAIL FAIL + #else +-#define DCHECK( ... ) ++#define DZBACKUP_CHECK( ... ) + #define DFAIL( ... ) + #endif + --- files/patch-chunk__id.cc (nonexistent) +++ files/patch-chunk__id.cc (working copy) @@ -0,0 +1,11 @@ +--- chunk_id.cc.orig 2016-10-12 01:34:15 UTC ++++ chunk_id.cc +@@ -48,7 +48,7 @@ bool operator <( const ChunkId &lhs, con + + ChunkId::ChunkId( string const & blob ) + { +- CHECK( blob.size() == BlobSize, "incorrect blob size: %zu", blob.size() ); ++ ZBACKUP_CHECK( blob.size() == BlobSize, "incorrect blob size: %zu", blob.size() ); + + setFromBlob( blob.data() ); + } --- files/patch-chunk__storage.cc (nonexistent) +++ files/patch-chunk__storage.cc (working copy) @@ -0,0 +1,11 @@ +--- chunk_storage.cc.orig 2016-10-12 01:34:15 UTC ++++ chunk_storage.cc +@@ -179,7 +179,7 @@ void * Writer::Compressor::Compressor::t + + { + Lock _( writer.runningCompressorsMutex ); +- CHECK( writer.runningCompressors, "no running compressors" ); ++ ZBACKUP_CHECK( writer.runningCompressors, "no running compressors" ); + --writer.runningCompressors; + writer.runningCompressorsCondition.signal(); + } --- files/patch-compression.cc (revision 423867) +++ files/patch-compression.cc (working copy) @@ -1,11 +1,119 @@ ---- compression.cc.orig 2015-06-23 12:18:26.923826000 +0800 -+++ compression.cc 2015-06-23 12:19:37.282685000 +0800 -@@ -292,7 +292,7 @@ +--- compression.cc.orig 2016-10-12 01:35:11 UTC ++++ compression.cc +@@ -55,7 +55,7 @@ public: + { + lzma_ret ret = lzma_code( &strm, ( finish ? LZMA_FINISH : LZMA_RUN ) ); + +- CHECK( ret == LZMA_OK || ret == LZMA_STREAM_END, "lzma_code error: %d", (int) ret ); ++ ZBACKUP_CHECK( ret == LZMA_OK || ret == LZMA_STREAM_END, "lzma_code error: %d", (int) ret ); + + return ( ret == LZMA_STREAM_END ); } +@@ -75,7 +75,7 @@ public: + uint32_t preset = 6; // TODO: make this customizable, although 6 seems to be + // the best option + lzma_ret ret = lzma_easy_encoder( &strm, preset, LZMA_CHECK_CRC64 ); +- CHECK( ret == LZMA_OK, "lzma_easy_encoder error: %d", (int) ret ); ++ ZBACKUP_CHECK( ret == LZMA_OK, "lzma_easy_encoder error: %d", (int) ret ); + } }; +@@ -85,7 +85,7 @@ public: + LZMADecoder() + { + lzma_ret ret = lzma_stream_decoder( &strm, UINT64_MAX, 0 ); +- CHECK( ret == LZMA_OK,"lzma_stream_decoder error: %d", (int) ret ); ++ ZBACKUP_CHECK( ret == LZMA_OK,"lzma_stream_decoder error: %d", (int) ret ); + } + }; + +@@ -292,7 +292,7 @@ private: + } + }; + -#include +#include // like NoStreamEnDecoder, but also adds the uncompressed size before the stream //NOTE You should make sure that the compression function doesn't overwrite any +@@ -329,7 +329,7 @@ protected: + + size_t suggestOutputSize( const char* dataIn, size_t availIn ) + { +- CHECK( availIn >= sizeof(uint64_t), "not enough input data" ); ++ ZBACKUP_CHECK( availIn >= sizeof(uint64_t), "not enough input data" ); + // We're not using size_t because we need a type that has the same size on all + // architectures. A 32-bit host won't be able to open files with more than + // 4GB (actually much less), so 4 byte are enough. Even a 64-bit host would +@@ -369,7 +369,7 @@ protected: + if ( !doProcessNoSize( dataIn, availIn, dataOut, availOut, reportedOutputSize ) ) + return false; + +- CHECK( reportedOutputSize == neededOutputSize, ++ ZBACKUP_CHECK( reportedOutputSize == neededOutputSize, + "Size of decoded data is different than expected" ); + + return true; +@@ -412,7 +412,7 @@ protected: + bool doProcess( const char* dataIn, size_t availIn, + char* dataOut, size_t availOut, size_t& outputSize ) + { +- CHECK( availIn <= UINT32_MAX, ++ ZBACKUP_CHECK( availIn <= UINT32_MAX, + "You want to compress more than 4GB of data?! Sorry, we don't support that, yet." ); + + memcpy(dataOut, "ABCDEFGHIJKLMNOP", 16); +@@ -429,7 +429,7 @@ protected: + if ( !doProcessNoSize( dataIn, availIn, dataOut, availOut, outputSize ) ) + return false; + +- CHECK( outputSize <= UINT32_MAX, ++ ZBACKUP_CHECK( outputSize <= UINT32_MAX, + "The compressed data is more than 4GB?! Sorry, we don't support that, yet." ); + *compressedSize = htole32( (uint32_t) outputSize ); + +@@ -459,7 +459,7 @@ protected: + if ( ret == LZO_E_OUTPUT_OVERRUN ) + return false; + +- CHECK( ret >= LZO_E_OK, "lzo1x_decompress_safe failed (code %d)", ret ); ++ ZBACKUP_CHECK( ret >= LZO_E_OK, "lzo1x_decompress_safe failed (code %d)", ret ); + + return true; + } +@@ -490,7 +490,7 @@ class LZO1X_1_Compression : public Compr + if (!initialized) + { + int ret = lzo_init(); +- CHECK( ret == LZO_E_OK, "lzo_init failed (%d)", ret ); ++ ZBACKUP_CHECK( ret == LZO_E_OK, "lzo_init failed (%d)", ret ); + initialized = true; + } + } +@@ -573,7 +573,7 @@ bool LZO1X_1_Encoder::doProcessNoSize( c + if ( ret == LZO_E_OUTPUT_OVERRUN ) + return false; + +- CHECK( ret >= LZO_E_OK, "lzo1x_1_compress failed (code %d)", ret ); ++ ZBACKUP_CHECK( ret >= LZO_E_OK, "lzo1x_1_compress failed (code %d)", ret ); + + return true; + } +@@ -644,7 +644,7 @@ bool CompressionMethod::iterator::atEnd( + + CompressionMethod::iterator& CompressionMethod::iterator::operator ++() + { +- CHECK( ptr && *ptr, "Cannot increment the end iterator" ); ++ ZBACKUP_CHECK( ptr && *ptr, "Cannot increment the end iterator" ); + + ++ptr; + +@@ -653,7 +653,7 @@ CompressionMethod::iterator& Compression + + const_sptr CompressionMethod::iterator::operator *() + { +- CHECK( ptr && *ptr, "Cannot dereference the end iterator" ); ++ ZBACKUP_CHECK( ptr && *ptr, "Cannot dereference the end iterator" ); + + return *ptr; + } --- files/patch-dir.cc (revision 423867) +++ files/patch-dir.cc (working copy) @@ -1,6 +1,6 @@ ---- dir.cc.orig 2015-06-23 12:16:14.909394000 +0800 -+++ dir.cc 2015-06-23 12:16:22.284741000 +0800 -@@ -103,7 +103,7 @@ +--- dir.cc.orig 2016-10-12 01:35:11 UTC ++++ dir.cc +@@ -103,7 +103,7 @@ bool Listing::getNext( Entry & result ) if ( !entryPtr ) return false; --- files/patch-encrypted__file.cc (nonexistent) +++ files/patch-encrypted__file.cc (working copy) @@ -0,0 +1,71 @@ +--- encrypted_file.cc.orig 2016-10-12 01:34:15 UTC ++++ encrypted_file.cc +@@ -79,10 +79,10 @@ bool InputStream::Next( void const ** da + + void InputStream::BackUp( int count ) + { +- CHECK( count >= 0, "count is negative" ); ++ ZBACKUP_CHECK( count >= 0, "count is negative" ); + if ( !backedUp ) + { +- CHECK( (size_t) count <= fill, "Backing up too much" ); ++ ZBACKUP_CHECK( (size_t) count <= fill, "Backing up too much" ); + size_t consumed = fill - count; + adler32.add( start, consumed ); + start += consumed; +@@ -92,13 +92,13 @@ void InputStream::BackUp( int count ) + } + else + { +- CHECK( count == 0, "backing up after being backed up already" ); ++ ZBACKUP_CHECK( count == 0, "backing up after being backed up already" ); + } + } + + bool InputStream::Skip( int count ) + { +- CHECK( count >= 0, "count is negative" ); ++ ZBACKUP_CHECK( count >= 0, "count is negative" ); + + // We always need to read and decrypt data, as otherwise both the state of + // CBC and adler32 would be incorrect +@@ -219,7 +219,7 @@ void InputStream::doDecrypt() + + // We don't throw an exception here as the interface we implement doesn't + // support them +- CHECK( fill > 0 && !( fill % BlockSize ), "incorrect size of the encrypted " ++ ZBACKUP_CHECK( fill > 0 && !( fill % BlockSize ), "incorrect size of the encrypted " + "file - must be non-zero and in multiples of %u", + ( unsigned ) BlockSize ); + +@@ -276,10 +276,10 @@ bool OutputStream::Next( void ** data, i + + void OutputStream::BackUp( int count ) + { +- CHECK( count >= 0, "count is negative" ); ++ ZBACKUP_CHECK( count >= 0, "count is negative" ); + if ( !backedUp ) + { +- CHECK( (size_t) count <= avail, "Backing up too much" ); ++ ZBACKUP_CHECK( (size_t) count <= avail, "Backing up too much" ); + size_t consumed = avail - count; + adler32.add( start, consumed ); + start += consumed; +@@ -289,7 +289,7 @@ void OutputStream::BackUp( int count ) + } + else + { +- CHECK( count == 0, "backing up after being backed up already" ); ++ ZBACKUP_CHECK( count == 0, "backing up after being backed up already" ); + } + } + +@@ -350,7 +350,7 @@ void OutputStream::encryptAndWrite( size + { + if ( key.hasKey() ) + { +- CHECK( bytes > 0 && !( bytes % BlockSize ), "incorrect number of bytes to " ++ ZBACKUP_CHECK( bytes > 0 && !( bytes % BlockSize ), "incorrect number of bytes to " + "encrypt and write - must be non-zero and in multiples of %u", + ( unsigned ) BlockSize ); + --- files/patch-encryption.cc (nonexistent) +++ files/patch-encryption.cc (working copy) @@ -0,0 +1,38 @@ +--- encryption.cc.orig 2016-10-12 01:34:15 UTC ++++ encryption.cc +@@ -19,7 +19,7 @@ void const * encrypt( void const * iv, v + { + unsigned char block[ BlockSize ]; + +- CHECK( !( size % BlockSize ), "size of data to encrypt is not a multiple of " ++ ZBACKUP_CHECK( !( size % BlockSize ), "size of data to encrypt is not a multiple of " + "block size" ); + + AES_KEY key; +@@ -55,7 +55,7 @@ void const * encrypt( void const * iv, v + + void const * getNextDecryptionIv( void const * in, size_t size ) + { +- CHECK( !( size % BlockSize ), "size of data to decrypt is not a multiple of " ++ ZBACKUP_CHECK( !( size % BlockSize ), "size of data to decrypt is not a multiple of " + "block size" ); + return ( char const * ) in + size - BlockSize; + } +@@ -63,7 +63,7 @@ void const * getNextDecryptionIv( void c + void decrypt( void const * iv, void const * keyData, void const * inData, + void * outData, size_t size ) + { +- CHECK( !( size % BlockSize ), "size of data to decrypt is not a multiple of " ++ ZBACKUP_CHECK( !( size % BlockSize ), "size of data to decrypt is not a multiple of " + "block size" ); + + AES_KEY key; +@@ -96,7 +96,7 @@ void decrypt( void const * iv, void cons + + void pad( void * data, size_t size ) + { +- CHECK( size < BlockSize, "size to pad is too large: %zu bytes", size ); ++ ZBACKUP_CHECK( size < BlockSize, "size to pad is too large: %zu bytes", size ); + unsigned char * p = ( unsigned char * ) data + size; + unsigned char v = BlockSize - size; + for ( size_t count = v; count--; ) --- files/patch-encryption__key.cc (nonexistent) +++ files/patch-encryption__key.cc (working copy) @@ -0,0 +1,20 @@ +--- encryption_key.cc.orig 2016-10-12 01:34:15 UTC ++++ encryption_key.cc +@@ -15,7 +15,7 @@ namespace { + void deriveKey( string const & password, EncryptionKeyInfo const & info, + void * key, unsigned keySize ) + { +- CHECK( PKCS5_PBKDF2_HMAC_SHA1( password.data(), password.size(), ++ ZBACKUP_CHECK( PKCS5_PBKDF2_HMAC_SHA1( password.data(), password.size(), + (unsigned char const *) info.salt().data(), + info.salt().size(), info.rounds(), keySize, + (unsigned char *) key ) == 1, +@@ -27,7 +27,7 @@ string calculateKeyHmac( void const * ke + { + char result[ EVP_MAX_MD_SIZE ]; + unsigned resultSize; +- CHECK( HMAC( EVP_sha1(), (unsigned char const *) key, keySize, ++ ZBACKUP_CHECK( HMAC( EVP_sha1(), (unsigned char const *) key, keySize, + (unsigned char const *) input.data(), input.size(), + (unsigned char *) result, &resultSize ), + "encryption key HMAC calcuation failed" ); --- files/patch-endian.hh (revision 423867) +++ files/patch-endian.hh (working copy) @@ -1,5 +1,5 @@ ---- endian.hh.orig 2014-11-08 22:55:49.000000000 +0800 -+++ endian.hh 2014-11-08 22:56:01.000000000 +0800 +--- endian.hh.orig 2016-10-12 01:35:11 UTC ++++ endian.hh @@ -6,7 +6,7 @@ #include --- files/patch-file.cc (revision 423867) +++ files/patch-file.cc (working copy) @@ -1,5 +1,5 @@ ---- file.cc.orig 2014-12-16 20:32:29.000000000 +0800 -+++ file.cc 2015-06-23 13:16:37.741129000 +0800 +--- file.cc.orig 2016-10-12 01:35:11 UTC ++++ file.cc @@ -6,7 +6,7 @@ #include #include @@ -9,7 +9,7 @@ #include #else #include -@@ -67,6 +67,9 @@ +@@ -67,6 +67,9 @@ void File::rename( std::string const & f #ifdef __APPLE__ if ( -1 == sendfile(write_fd, read_fd, offset, &stat_buf.st_size, NULL, 0) ) throw exCantRename( from + " to " + to ); --- files/patch-mt.cc (nonexistent) +++ files/patch-mt.cc (working copy) @@ -0,0 +1,18 @@ +--- mt.cc.orig 2016-10-12 01:34:15 UTC ++++ mt.cc +@@ -58,13 +58,13 @@ void * Thread::__thread_routine( void * + + void Thread::start() + { +- CHECK( pthread_create( &thread, 0, &__thread_routine, this ) == 0, ++ ZBACKUP_CHECK( pthread_create( &thread, 0, &__thread_routine, this ) == 0, + "pthread_create() failed" ); + } + + void Thread::detach() + { +- CHECK( pthread_detach( thread ) == 0, "pthread_detach() failed" ); ++ ZBACKUP_CHECK( pthread_detach( thread ) == 0, "pthread_detach() failed" ); + } + + void * Thread::join() --- files/patch-tests_bundle_test__bundle.cc (nonexistent) +++ files/patch-tests_bundle_test__bundle.cc (working copy) @@ -0,0 +1,35 @@ +--- tests/bundle/test_bundle.cc.orig 2016-10-12 01:34:15 UTC ++++ tests/bundle/test_bundle.cc +@@ -48,8 +48,8 @@ void testCompatibility() + BundleFileHeader header; + Message::parse( header, is ); + +- CHECK( header.version() == 42, "version is wrong when reading old header with new program" ); +- CHECK( header.compression_method() == "lzma", "compression_method is wrong when reading old header with new program" ); ++ ZBACKUP_CHECK( header.version() == 42, "version is wrong when reading old header with new program" ); ++ ZBACKUP_CHECK( header.compression_method() == "lzma", "compression_method is wrong when reading old header with new program" ); + } + } + +@@ -71,7 +71,7 @@ void testCompatibility() + FileHeader header; + Message::parse( header, is ); + +- CHECK( header.version() == 42, "version is wrong when reading new header with old program" ); ++ ZBACKUP_CHECK( header.version() == 42, "version is wrong when reading new header with old program" ); + // cannot check compression_method because the field doesn't exist + } + } +@@ -123,9 +123,9 @@ void readAndWrite( EncryptionKey const & + string data; + size_t size; + bool ret = bundle.get( chunkIds[i], data, size ); +- CHECK( ret, "bundle.get returned false for chunk %d (%s)", i, chunkIds[i].c_str() ); +- CHECK( size == chunkSize, "wrong chunk size for chunk %d (%s)", i, chunkIds[i].c_str() ); +- CHECK( memcmp(data.c_str(), chunks[i], chunkSize) == 0, "wrong chunk data for chunk %d (%s)", i, chunkIds[i].c_str() ); ++ ZBACKUP_CHECK( ret, "bundle.get returned false for chunk %d (%s)", i, chunkIds[i].c_str() ); ++ ZBACKUP_CHECK( size == chunkSize, "wrong chunk size for chunk %d (%s)", i, chunkIds[i].c_str() ); ++ ZBACKUP_CHECK( memcmp(data.c_str(), chunks[i], chunkSize) == 0, "wrong chunk data for chunk %d (%s)", i, chunkIds[i].c_str() ); + } + } + --- files/patch-tests_encrypted__file_test__encrypted__file.cc (nonexistent) +++ files/patch-tests_encrypted__file_test__encrypted__file.cc (working copy) @@ -0,0 +1,89 @@ +--- tests/encrypted_file/test_encrypted_file.cc.orig 2016-10-12 01:34:15 UTC ++++ tests/encrypted_file/test_encrypted_file.cc +@@ -47,11 +47,11 @@ void readAndWrite( EncryptionKey const & + int avail = 0; + for ( int left = fileSize; left; ) + { +- CHECK( out.ByteCount() == fileSize - left, "Incorrect bytecount in the " ++ ZBACKUP_CHECK( out.ByteCount() == fileSize - left, "Incorrect bytecount in the " + "middle of writing" ); + void * data; +- CHECK( out.Next( &data, &avail ), "out.Next() returned false" ); +- CHECK( avail > 0, "out.Next() returned zero size" ); ++ ZBACKUP_CHECK( out.Next( &data, &avail ), "out.Next() returned false" ); ++ ZBACKUP_CHECK( avail > 0, "out.Next() returned zero size" ); + + bool doBackup = writeBackups && ( rand() & 1 ); + int backup; +@@ -77,7 +77,7 @@ void readAndWrite( EncryptionKey const & + + if ( !avail && ( rand() & 1 ) ) + { +- CHECK( adler( next - rnd ) == out.getAdler32(), ++ ZBACKUP_CHECK( adler( next - rnd ) == out.getAdler32(), + "bad adler32 in the middle of writing" ); + } + } +@@ -85,11 +85,11 @@ void readAndWrite( EncryptionKey const & + if ( avail || ( rand() & 1 ) ) + out.BackUp( avail ); + +- CHECK( out.ByteCount() == fileSize, "Incorrect bytecount after writing" ); ++ ZBACKUP_CHECK( out.ByteCount() == fileSize, "Incorrect bytecount after writing" ); + + if ( rand() & 1 ) + { +- CHECK( adler( fileSize ) == out.getAdler32(), ++ ZBACKUP_CHECK( adler( fileSize ) == out.getAdler32(), + "bad adler32 of the written file" ); + } + } +@@ -114,11 +114,11 @@ void readAndWrite( EncryptionKey const & + continue; + } + +- CHECK( in.ByteCount() == fileSize - left, "Incorrect bytecount in the " ++ ZBACKUP_CHECK( in.ByteCount() == fileSize - left, "Incorrect bytecount in the " + "middle of reading" ); +- CHECK( in.Next( &data, &avail ), "file ended while %d were still left", ++ ZBACKUP_CHECK( in.Next( &data, &avail ), "file ended while %d were still left", + left ); +- CHECK( avail > 0, "in.Next() returned zero size" ); ++ ZBACKUP_CHECK( avail > 0, "in.Next() returned zero size" ); + + bool doBackup = readBackups && ( rand() & 1 ); + int backup; +@@ -130,7 +130,7 @@ void readAndWrite( EncryptionKey const & + + int toRead = avail > left ? left : avail; + +- CHECK( memcmp( next, data, toRead ) == 0, "Different bytes read than " ++ ZBACKUP_CHECK( memcmp( next, data, toRead ) == 0, "Different bytes read than " + "expected at offset %d", int( next - rnd ) ); + + if ( doBackup ) +@@ -142,19 +142,19 @@ void readAndWrite( EncryptionKey const & + + if ( !avail && ( rand() & 1 ) ) + { +- CHECK( adler( next - rnd ) == in.getAdler32(), ++ ZBACKUP_CHECK( adler( next - rnd ) == in.getAdler32(), + "bad adler32 in the middle of the reading" ); + } + } + +- CHECK( in.ByteCount() == fileSize, "Incorrect bytecount after reading" ); ++ ZBACKUP_CHECK( in.ByteCount() == fileSize, "Incorrect bytecount after reading" ); + +- CHECK( !avail, "at least %d bytes still available", avail ); +- CHECK( !in.Next( &data, &avail ), "file should have ended but resulted in " ++ ZBACKUP_CHECK( !avail, "at least %d bytes still available", avail ); ++ ZBACKUP_CHECK( !in.Next( &data, &avail ), "file should have ended but resulted in " + "%d more bytes", avail ); + if ( rand() & 1 ) + { +- CHECK( adler( fileSize ) == in.getAdler32(), ++ ZBACKUP_CHECK( adler( fileSize ) == in.getAdler32(), + "bad adler32 of the read file" ); + } + } --- files/patch-unbuffered__file.cc (nonexistent) +++ files/patch-unbuffered__file.cc (working copy) @@ -0,0 +1,38 @@ +--- unbuffered_file.cc.orig 2016-10-12 01:35:11 UTC ++++ unbuffered_file.cc +@@ -13,7 +13,7 @@ + #include "unbuffered_file.hh" + + +-#ifdef __APPLE__ ++#if defined(__APPLE_) || defined(__FreeBSD__) + #define lseek64 lseek + #endif + +@@ -24,7 +24,7 @@ UnbufferedFile::UnbufferedFile( char con + + int flags = ( mode == WriteOnly ? ( O_WRONLY | O_CREAT | O_TRUNC ) : + O_RDONLY ); +-#ifndef __APPLE__ ++#if !defined(__APPLE__) && !defined(__FreeBSD__) + flags |= O_LARGEFILE; + #endif + fd = open( fileName, flags, 0666 ); +@@ -49,7 +49,7 @@ size_t UnbufferedFile::read( void * buf, + else + if ( rd > 0 ) + { +- CHECK( ( size_t ) rd <= left, "read too many bytes from a file" ); ++ ZBACKUP_CHECK( ( size_t ) rd <= left, "read too many bytes from a file" ); + next += rd; + left -= rd; + } +@@ -76,7 +76,7 @@ void UnbufferedFile::write( void const * + } + else + { +- CHECK( ( size_t ) written <= left, "wrote too many bytes to a file" ); ++ ZBACKUP_CHECK( ( size_t ) written <= left, "wrote too many bytes to a file" ); + next += written; + left -= written; + } --- files/patch-unbuffered_file.cc (revision 423867) +++ files/patch-unbuffered_file.cc (nonexistent) @@ -1,20 +0,0 @@ ---- unbuffered_file.cc.orig 2014-11-08 22:56:14.000000000 +0800 -+++ unbuffered_file.cc 2014-11-08 22:56:25.000000000 +0800 -@@ -13,7 +13,7 @@ - #include "unbuffered_file.hh" - - --#ifdef __APPLE__ -+#if defined(__APPLE_) || defined(__FreeBSD__) - #define lseek64 lseek - #endif - -@@ -24,7 +24,7 @@ - - int flags = ( mode == WriteOnly ? ( O_WRONLY | O_CREAT | O_TRUNC ) : - O_RDONLY ); --#ifndef __APPLE__ -+#if !defined(__APPLE__) && !defined(__FreeBSD__) - flags |= O_LARGEFILE; - #endif - fd = open( fileName, flags, 0666 ); --- files/patch-zcollector.cc (revision 423867) +++ files/patch-zcollector.cc (working copy) @@ -1,5 +1,5 @@ ---- zcollector.cc.orig 2016-01-02 22:43:40.800025000 +0800 -+++ zcollector.cc 2016-01-02 22:44:51.222600000 +0800 +--- zcollector.cc.orig 2016-10-12 01:35:11 UTC ++++ zcollector.cc @@ -1,6 +1,8 @@ // Copyright (c) 2012-2014 Konstantin Isakov and ZBackup contributors, see CONTRIBUTORS // Part of ZBackup. Licensed under GNU GPLv2 or later + OpenSSL, see LICENSE