Merging upstream version 1.6~pre1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2e57dd92fa
commit
a1e23002e1
15 changed files with 149 additions and 142 deletions
14
main.c
14
main.c
|
@ -54,6 +54,10 @@
|
|||
#include "carg_parser.h"
|
||||
#include "lzlib.h"
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
#if CHAR_BIT != 8
|
||||
#error "Environments where CHAR_BIT != 8 are not supported."
|
||||
#endif
|
||||
|
@ -75,12 +79,6 @@ const char * const program_name = "minilzip";
|
|||
const char * const program_year = "2013";
|
||||
const char * invocation_name = 0;
|
||||
|
||||
#ifdef O_BINARY
|
||||
const int o_binary = O_BINARY;
|
||||
#else
|
||||
const int o_binary = 0;
|
||||
#endif
|
||||
|
||||
struct { const char * from; const char * to; } const known_extensions[] = {
|
||||
{ ".lz", "" },
|
||||
{ ".tlz", ".tar" },
|
||||
|
@ -306,7 +304,7 @@ static int open_instream( const char * const name, struct stat * const in_statsp
|
|||
}
|
||||
else
|
||||
{
|
||||
infd = open( name, O_RDONLY | o_binary );
|
||||
infd = open( name, O_RDONLY | O_BINARY );
|
||||
if( infd < 0 )
|
||||
{
|
||||
if( verbosity >= 0 )
|
||||
|
@ -387,7 +385,7 @@ static void set_d_outname( const char * const name, const int i )
|
|||
|
||||
static bool open_outstream( const bool force )
|
||||
{
|
||||
int flags = O_CREAT | O_WRONLY | o_binary;
|
||||
int flags = O_CREAT | O_WRONLY | O_BINARY;
|
||||
if( force ) flags |= O_TRUNC; else flags |= O_EXCL;
|
||||
|
||||
outfd = open( output_filename, flags, outfd_mode );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue