diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:41:34 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:41:34 +0000 |
commit | 9babb5bc11dd99942f6077669fa806d83ef146ff (patch) | |
tree | 5f2af8fceb7f878989259f6b65c6483c52891ec9 /range_dec.cc | |
parent | Adding upstream version 1.14. (diff) | |
download | lziprecover-9babb5bc11dd99942f6077669fa806d83ef146ff.tar.xz lziprecover-9babb5bc11dd99942f6077669fa806d83ef146ff.zip |
Adding upstream version 1.15~pre1.upstream/1.15_pre1
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'range_dec.cc')
-rw-r--r-- | range_dec.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/range_dec.cc b/range_dec.cc index 59be01f..27ceba3 100644 --- a/range_dec.cc +++ b/range_dec.cc @@ -101,13 +101,6 @@ void parse_range( const char * const ptr, Block & range ) } -bool safe_seek( const int fd, const long long pos ) - { - if( lseek( fd, pos, SEEK_SET ) == pos ) return true; - show_error( "Seek error", errno ); return false; - } - - int decompress_member( const int infd, const int outfd, const Pretty_print & pp, const unsigned long long mpos, @@ -170,7 +163,7 @@ int list_file( const std::string & input_filename, const Pretty_print & pp ) const int infd = open_instream( input_filename, &in_stats, true, true ); if( infd < 0 ) return 1; - File_index file_index( infd ); + const File_index file_index( infd ); close( infd ); if( file_index.retval() != 0 ) { show_error( file_index.error().c_str() ); return file_index.retval(); } @@ -208,6 +201,13 @@ int list_file( const std::string & input_filename, const Pretty_print & pp ) } // end namespace +bool safe_seek( const int fd, const long long pos ) + { + if( lseek( fd, pos, SEEK_SET ) == pos ) return true; + show_error( "Seek error", errno ); return false; + } + + int list_files( const std::vector< std::string > & filenames, const int verbosity ) { @@ -234,7 +234,7 @@ int range_decompress( const std::string & input_filename, const int infd = open_instream( input_filename, &in_stats, true, true ); if( infd < 0 ) return 1; - File_index file_index( infd ); + const File_index file_index( infd ); if( file_index.retval() != 0 ) { show_error( file_index.error().c_str() ); return file_index.retval(); } @@ -259,6 +259,7 @@ int range_decompress( const std::string & input_filename, else { outfd = open_outstream_rw( output_filename, force ); if( outfd < 0 ) return 1; } + Pretty_print pp( input_filename, verbosity ); int retval = 0; for( int i = 0; i < file_index.members(); ++i ) |