From 79cd96ee549de2d24d5ba81d6f8fa4d642943b52 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 12:51:28 +0100 Subject: Merging upstream version 1.17~rc2. Signed-off-by: Daniel Baumann --- main.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'main.cc') diff --git a/main.cc b/main.cc index 192f32b..a1bf966 100644 --- a/main.cc +++ b/main.cc @@ -372,14 +372,14 @@ void cleanup_and_fail( const int retval ) } - // Set permissions, owner and times. + /* Set permissions, owner and times. */ void close_and_set_permissions( const struct stat * const in_statsp ) { bool warning = false; if( in_statsp ) { const mode_t mode = in_statsp->st_mode; - // fchown will in many cases return with EPERM, which can be safely ignored. + /* fchown will in many cases return with EPERM, which can be safely ignored. */ if( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) == 0 ) { if( fchmod( outfd, mode ) != 0 ) warning = true; } else @@ -579,19 +579,19 @@ void show_error( const char * const msg, const int errcode, const bool help ) } -void show_error2( const char * const msg1, const char * const name, - const char * const msg2 ) +void internal_error( const char * const msg ) { if( verbosity >= 0 ) - std::fprintf( stderr, "%s: %s '%s' %s\n", program_name, msg1, name, msg2 ); + std::fprintf( stderr, "%s: internal error: %s\n", program_name, msg ); + std::exit( 3 ); } -void internal_error( const char * const msg ) +void show_error2( const char * const msg1, const char * const name, + const char * const msg2 ) { if( verbosity >= 0 ) - std::fprintf( stderr, "%s: internal error: %s\n", program_name, msg ); - std::exit( 3 ); + std::fprintf( stderr, "%s: %s '%s' %s\n", program_name, msg1, name, msg2 ); } @@ -642,7 +642,7 @@ int main( const int argc, const char * const argv[] ) for( ; argind < parser.arguments(); ++argind ) { const int code = parser.code( argind ); - if( !code ) break; // no more options + if( !code ) break; /* no more options */ const std::string & arg = parser.argument( argind ); switch( code ) { @@ -670,7 +670,7 @@ int main( const int argc, const char * const argv[] ) parse_pos_value( arg.c_str(), bad_pos, bad_value ); break; default : internal_error( "uncaught option." ); } - } // end process options + } /* end process options */ #if defined(__MSVCRT__) || defined(__OS2__) setmode( STDIN_FILENO, O_BINARY ); -- cgit v1.2.3