diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,5 +1,5 @@ /* Lunzip - Decompressor for lzip files - Copyright (C) 2010 Antonio Diaz Diaz. + Copyright (C) 2010, 2011 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ long long int llabs( long long int number ); const char * const Program_name = "Lunzip"; const char * const program_name = "lunzip"; -const char * const program_year = "2010"; +const char * const program_year = "2011"; const char * invocation_name = 0; #ifdef O_BINARY @@ -106,7 +106,7 @@ static void show_help() printf( " -h, --help display this help and exit\n" ); printf( " -V, --version output version information and exit\n" ); printf( " -c, --stdout send output to standard output\n" ); - printf( " -d, --decompress decompress\n" ); + printf( " -d, --decompress decompress (this is the default)\n" ); printf( " -f, --force overwrite existing output files\n" ); printf( " -k, --keep keep (don't delete) input files\n" ); printf( " -o, --output=<file> if reading stdin, place the output into <file>\n" ); @@ -260,9 +260,10 @@ static void close_and_set_permissions( const struct stat * const in_statsp ) bool error = false; if( in_statsp ) { - if( fchmod( outfd, in_statsp->st_mode ) != 0 || - ( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) != 0 && - errno != EPERM ) ) error = true; + if( ( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) != 0 && + errno != EPERM ) || + fchmod( outfd, in_statsp->st_mode ) != 0 ) + error = true; /* fchown will in many cases return with EPERM, which can be safely ignored. */ } if( close( outfd ) == 0 ) outfd = -1; |