1
0
Fork 0

Merging upstream version 1.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 04:10:09 +01:00
parent e627412516
commit 8b0a7cb0e8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
16 changed files with 182 additions and 181 deletions

View file

@ -37,6 +37,23 @@
#include "file_index.h"
void Pretty_print::operator()( const char * const msg ) const
{
if( verbosity >= 0 )
{
if( first_post )
{
first_post = false;
std::fprintf( stderr, " %s: ", name_.c_str() );
for( unsigned i = 0; i < longest_name - name_.size(); ++i )
std::fputc( ' ', stderr );
if( !msg ) std::fflush( stderr );
}
if( msg ) std::fprintf( stderr, "%s\n", msg );
}
}
// Returns the number of bytes really read.
// If (returned value < size) and (errno == 0), means EOF was reached.
//
@ -82,7 +99,7 @@ int decompress_read_error( struct LZ_Decoder * const decoder,
const LZ_Errno errcode = LZ_decompress_errno( decoder );
pp();
if( verbosity >= 0 )
std::fprintf( stderr, "LZ_decompress_read error in worker %d: %s.\n",
std::fprintf( stderr, "LZ_decompress_read error in worker %d: %s\n",
worker_id, LZ_strerror( errcode ) );
if( errcode == LZ_header_error || errcode == LZ_unexpected_eof ||
errcode == LZ_data_error )
@ -160,7 +177,7 @@ extern "C" void * dworker( void * arg )
{
pp();
if( verbosity >= 0 )
std::fprintf( stderr, "Write error in worker %d: %s.\n",
std::fprintf( stderr, "Write error in worker %d: %s\n",
worker_id, std::strerror( errno ) );
cleanup_and_fail();
}
@ -260,7 +277,7 @@ int decompress( int num_workers, const int infd, const int outfd,
std::fprintf( stderr, "decompressed size %9llu, size %9llu. ",
out_size, in_size );
if( verbosity >= 1 ) std::fprintf( stderr, (outfd < 0) ? "ok\n" : "done\n" );
if( verbosity >= 1 ) std::fputs( (outfd < 0) ? "ok\n" : "done\n", stderr );
return 0;
}