summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 13:13:20 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 13:13:20 +0000
commite84a38cf471105cb888595baeb858a02e4c301fe (patch)
tree6df69a27d8a6c0b18e8bc9f52968a84686ccb0bf /main.c
parentAdding upstream version 1.0~rc1. (diff)
downloadlunzip-e84a38cf471105cb888595baeb858a02e4c301fe.tar.xz
lunzip-e84a38cf471105cb888595baeb858a02e4c301fe.zip
Adding upstream version 1.0.upstream/1.0
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/main.c b/main.c
index 11d733b..0649d1d 100644
--- a/main.c
+++ b/main.c
@@ -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;