Merging upstream version 0.15.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
edd0dce1fe
commit
b3a2ab2af7
51 changed files with 1255 additions and 507 deletions
27
create_lz.cc
27
create_lz.cc
|
@ -83,13 +83,13 @@ public:
|
|||
|
||||
struct Ipacket // filename, file size and headers
|
||||
{
|
||||
const unsigned long long file_size;
|
||||
const long long file_size;
|
||||
const std::string filename; // filename.empty() means end of lzip member
|
||||
const Extended * const extended;
|
||||
const uint8_t * const header;
|
||||
|
||||
Ipacket() : file_size( 0 ), extended( 0 ), header( 0 ) {}
|
||||
Ipacket( const char * const name, const unsigned long long s,
|
||||
Ipacket( const char * const name, const long long s,
|
||||
const Extended * const ext, const uint8_t * const head )
|
||||
: file_size( s ), filename( name ), extended( ext ), header( head ) {}
|
||||
};
|
||||
|
@ -260,8 +260,8 @@ public:
|
|||
int add_member_lz( const char * const filename, const struct stat *,
|
||||
const int flag, struct FTW * )
|
||||
{
|
||||
if( Exclude::excluded( filename ) ) return 0; // skip excluded
|
||||
unsigned long long file_size = 0;
|
||||
if( Exclude::excluded( filename ) ) return 0; // skip excluded files
|
||||
long long file_size;
|
||||
// metadata for extended records
|
||||
Extended * const extended = new( std::nothrow ) Extended;
|
||||
uint8_t * const header = extended ? new( std::nothrow ) Tar_header : 0;
|
||||
|
@ -315,7 +315,7 @@ extern "C" void * grouper( void * arg )
|
|||
while( len > 1 && arg[len-1] == '/' ) --len;
|
||||
if( len < arg.size() )
|
||||
{ deslashed.assign( arg, 0, len ); filename = deslashed.c_str(); }
|
||||
if( Exclude::excluded( filename ) ) continue; // skip excluded
|
||||
if( Exclude::excluded( filename ) ) continue; // skip excluded files
|
||||
struct stat st;
|
||||
if( lstat( filename, &st ) != 0 ) // filename from command line
|
||||
{ show_file_error( filename, "Can't stat input file", errno );
|
||||
|
@ -463,12 +463,12 @@ extern "C" void * cworker( void * arg )
|
|||
|
||||
if( ipacket->file_size )
|
||||
{
|
||||
enum { bufsize = 32 * header_size };
|
||||
const long long bufsize = 32 * header_size;
|
||||
uint8_t buf[bufsize];
|
||||
unsigned long long rest = ipacket->file_size;
|
||||
long long rest = ipacket->file_size;
|
||||
while( rest > 0 )
|
||||
{
|
||||
int size = std::min( rest, (unsigned long long)bufsize );
|
||||
int size = std::min( rest, bufsize );
|
||||
const int rd = readblock( infd, buf, size );
|
||||
rest -= rd;
|
||||
if( rd != size )
|
||||
|
@ -521,10 +521,10 @@ void muxer( Packet_courier & courier, const int outfd )
|
|||
|
||||
|
||||
// init the courier, then start the grouper and the workers and call the muxer
|
||||
int encode_lz( const Arg_parser & parser, const int dictionary_size,
|
||||
const int match_len_limit, const int num_workers,
|
||||
const int outfd, const int out_slots, const int debug_level,
|
||||
const bool dereference )
|
||||
int encode_lz( const char * const archive_namep, const Arg_parser & parser,
|
||||
const int dictionary_size, const int match_len_limit,
|
||||
const int num_workers, const int outfd, const int out_slots,
|
||||
const int debug_level, const bool dereference )
|
||||
{
|
||||
const int in_slots = 65536; // max small files (<=512B) in 64 MiB
|
||||
const int total_in_slots = ( INT_MAX / num_workers >= in_slots ) ?
|
||||
|
@ -579,7 +579,8 @@ int encode_lz( const Arg_parser & parser, const int dictionary_size,
|
|||
int retval = !write_eof_records( outfd, true );
|
||||
|
||||
if( close( outfd ) != 0 && !retval )
|
||||
{ show_error( "Error closing archive", errno ); retval = 1; }
|
||||
{ show_file_error( archive_namep, "Error closing archive", errno );
|
||||
retval = 1; }
|
||||
|
||||
if( debug_level & 1 )
|
||||
std::fprintf( stderr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue