1
0
Fork 0

Adding upstream version 0.21.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 21:15:58 +01:00
parent 7bf1f2e322
commit cc1b855cb3
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
27 changed files with 961 additions and 324 deletions

View file

@ -19,15 +19,11 @@
#include <algorithm>
#include <cerrno>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <string>
#include <vector>
#include <pthread.h>
#include <stdint.h>
#include <stdint.h> // for lzlib.h
#include <unistd.h>
#include <utime.h>
#include <sys/stat.h>
@ -37,8 +33,8 @@
#endif
#include <lzlib.h>
#include "arg_parser.h"
#include "tarlz.h"
#include "arg_parser.h"
#include "lzip_index.h"
#include "archive_reader.h"
@ -610,11 +606,16 @@ extern "C" void * dworker( void * arg )
extended.fill_from_ustar( header ); // copy metadata from header
/* Skip members with an empty name in the ustar header. If there is an
extended header in a previous lzip member, its worker will request
mastership. Else the ustar-only unnamed member will be ignored. */
const char * msg;
if( check_skip_filename( cl_opts, name_pending, extended.path().c_str() ) )
msg = skip_member_lz( ar, courier, extended, i, worker_id );
else if( cl_opts.program_mode == m_list )
msg = list_member_lz( ar, courier, extended, header, rbuf, i, worker_id );
else if( extended.path().empty() )
msg = skip_member_lz( ar, courier, extended, i, worker_id );
else if( cl_opts.program_mode == m_diff )
msg = compare_member_lz( cl_opts, ar, courier, extended, header,
rbuf, i, worker_id );
@ -657,7 +658,7 @@ void muxer( const char * const archive_namep, Packet_courier & courier )
}
if( !error && !courier.eof_found() ) // no worker found EOF blocks
{ show_file_error( archive_namep, end_msg ); error = true; }
if( error ) cleanup_and_fail( 2 );
if( error ) exit_fail_mt( 2 );
}
} // end namespace
@ -693,7 +694,7 @@ int decode_lz( const Cl_options & cl_opts, const Archive_descriptor & ad,
const int errcode =
pthread_create( &worker_threads[i], 0, dworker, &worker_args[i] );
if( errcode )
{ show_error( "Can't create worker threads", errcode ); cleanup_and_fail(); }
{ show_error( "Can't create worker threads", errcode ); exit_fail_mt(); }
}
muxer( ad.namep, courier );
@ -702,7 +703,7 @@ int decode_lz( const Cl_options & cl_opts, const Archive_descriptor & ad,
{
const int errcode = pthread_join( worker_threads[i], 0 );
if( errcode )
{ show_error( "Can't join worker threads", errcode ); cleanup_and_fail(); }
{ show_error( "Can't join worker threads", errcode ); exit_fail_mt(); }
}
delete[] worker_threads;
delete[] worker_args;