diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 14:00:28 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 14:00:28 +0000 |
commit | 01c49d142d098985fd0951397e6dfe032b19e265 (patch) | |
tree | ea1574894741dd5fa797703f3bcc4580ba530063 /main.c | |
parent | Adding upstream version 1.5. (diff) | |
download | lzlib-01c49d142d098985fd0951397e6dfe032b19e265.tar.xz lzlib-01c49d142d098985fd0951397e6dfe032b19e265.zip |
Adding upstream version 1.6~pre1.upstream/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 ); |