From 67258f475f17f3824c5715eaa4ebdfee86f20142 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 8 Nov 2015 05:19:00 +0100 Subject: Merging upstream version 0.9~rc1. Signed-off-by: Daniel Baumann --- zcmp.cc | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'zcmp.cc') diff --git a/zcmp.cc b/zcmp.cc index caa7852..a2779b9 100644 --- a/zcmp.cc +++ b/zcmp.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -166,9 +165,8 @@ long long getnum( const char * const ptr, const char ** const tailp = 0, int open_instream( const std::string & input_filename ) throw() { int infd = open( input_filename.c_str(), O_RDONLY | o_binary ); - if( infd < 0 && verbosity >= 0 ) - std::fprintf( stderr, "%s: Can't open input file `%s': %s.\n", - util_name, input_filename.c_str(), std::strerror( errno ) ); + if( infd < 0 ) + show_error2( "Can't open input file", input_filename.c_str() ); return infd; } @@ -293,9 +291,7 @@ int cmp( const long long max_size, const int infd[2], rd[i] = readblock( infd[i], buffer[i], size ); if( rd[i] != size && errno ) { - if( verbosity >= 0 ) - std::fprintf( stderr, "%s: Error reading file `%s': %s.\n", - util_name, filenames[i].c_str(), std::strerror( errno ) ); + show_error2( "Error reading file", filenames[i].c_str() ); return 2; } } @@ -467,9 +463,7 @@ int main( const int argc, const char * const argv[] ) for( int i = 0; i < 2; ++i ) if( !skip_ignore_initial( ignore_initial[i], infd[i] ) ) { - if( verbosity >= 0 ) - std::fprintf( stderr, "%s: Can't skip initial bytes from file `%s': %s.\n", - util_name, filenames[i].c_str(), std::strerror( errno ) ); + show_error2( "Can't skip initial bytes from file", filenames[i].c_str() ); return 2; } @@ -483,12 +477,10 @@ int main( const int argc, const char * const argv[] ) for( int i = 0; i < 2; ++i ) { if( close( infd[i] ) != 0 ) - { show_error( "Can't close output of data feeder", errno ); retval = 2; } + { show_close_error( "data feeder" ); retval = 2; } if( filenames[i] != "-" && close( old_infd[i] ) != 0 ) { - if( verbosity >= 0 ) - std::fprintf( stderr, "%s: Can't close input file `%s': %s.\n", - util_name, filenames[i].c_str(), std::strerror( errno ) ); + show_error2( "Can't close input file", filenames[i].c_str() ); retval = 2; } } -- cgit v1.2.3