From 18525b97f1a4b60884962d8fb326e8e85d837686 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 17 Jul 2021 09:43:33 +0200 Subject: Merging upstream version 0.21. Signed-off-by: Daniel Baumann --- decode_lz.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'decode_lz.cc') diff --git a/decode_lz.cc b/decode_lz.cc index 4fc3d80..2bbb000 100644 --- a/decode_lz.cc +++ b/decode_lz.cc @@ -19,15 +19,11 @@ #include #include -#include #include #include -#include #include -#include -#include #include -#include +#include // for lzlib.h #include #include #include @@ -37,8 +33,8 @@ #endif #include -#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; -- cgit v1.2.3