summaryrefslogtreecommitdiffstats
path: root/zcmpdiff.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:30:25 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:30:25 +0000
commitb4e85477b84918c0fb9da281cebe4eff2a50f002 (patch)
tree545a8391c25b7e98c76f8deb43c3df7919e00111 /zcmpdiff.cc
parentAdding debian version 1.2~pre2-1. (diff)
downloadzutils-b4e85477b84918c0fb9da281cebe4eff2a50f002.tar.xz
zutils-b4e85477b84918c0fb9da281cebe4eff2a50f002.zip
Merging upstream version 1.2~pre3.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'zcmpdiff.cc')
-rw-r--r--zcmpdiff.cc12
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;