diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-08 04:30:18 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-08 04:30:18 +0000 |
commit | e2010b31ef4137540c264f2fb69f8f2660a6f7fc (patch) | |
tree | f6dc13301edd0ff87720cbb52123d6b0832b293b /zcmpdiff.cc | |
parent | Adding upstream version 1.2~pre2. (diff) | |
download | zutils-e2010b31ef4137540c264f2fb69f8f2660a6f7fc.tar.xz zutils-e2010b31ef4137540c264f2fb69f8f2660a6f7fc.zip |
Adding upstream version 1.2~pre3.upstream/1.2_pre3
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | zcmpdiff.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/zcmpdiff.cc b/zcmpdiff.cc index 71bcec6..d02a85f 100644 --- a/zcmpdiff.cc +++ b/zcmpdiff.cc @@ -15,10 +15,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef O_BINARY -const int o_binary = O_BINARY; -#else -const int o_binary = 0; +#ifndef O_BINARY +#define O_BINARY 0 #endif struct { const char * from; const char * to; } const known_extensions[] = { @@ -36,7 +34,7 @@ struct { const char * from; const char * to; } const known_extensions[] = { int open_instream( const std::string & input_filename ) { - int infd = open( input_filename.c_str(), O_RDONLY | o_binary ); + int infd = open( input_filename.c_str(), O_RDONLY | O_BINARY ); if( infd < 0 ) show_error2( "Can't open input file", input_filename.c_str() ); return infd; @@ -53,13 +51,13 @@ int open_other_instream( std::string & name ) { name.resize( name.size() - from.size() ); name += known_extensions[i].to; - return open( name.c_str(), O_RDONLY | o_binary ); + return open( name.c_str(), O_RDONLY | O_BINARY ); } } for( int i = 0; i < num_formats; ++i ) { // search compressed version const std::string s( name + simple_extensions[format_order[i]] ); - const int infd = open( s.c_str(), O_RDONLY | o_binary ); + const int infd = open( s.c_str(), O_RDONLY | O_BINARY ); if( infd >= 0 ) { name = s; return infd; } } return -1; |