summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:51:28 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:51:28 +0000
commit79cd96ee549de2d24d5ba81d6f8fa4d642943b52 (patch)
tree61504e983e7adf383ff88c409233c92e5ff9ed4a /main.cc
parentAdding debian version 1.17~rc1-1. (diff)
downloadlziprecover-79cd96ee549de2d24d5ba81d6f8fa4d642943b52.tar.xz
lziprecover-79cd96ee549de2d24d5ba81d6f8fa4d642943b52.zip
Merging upstream version 1.17~rc2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc20
1 files changed, 10 insertions, 10 deletions
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 );