diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 14:00:38 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 14:00:38 +0000 |
commit | c14d1693bdd22c33c4cf48acb77cf51b1769dc77 (patch) | |
tree | c6fd25510d2ff466252686512f69d8ca9ba155c8 /main.c | |
parent | Adding debian version 1.5-1. (diff) | |
download | lzlib-c14d1693bdd22c33c4cf48acb77cf51b1769dc77.tar.xz lzlib-c14d1693bdd22c33c4cf48acb77cf51b1769dc77.zip |
Merging upstream version 1.6~pre1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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 ); |