diff options
Diffstat (limited to 'zcmpdiff.cc')
-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; |