Windows: fix missing O_BINARY. Reinstate image tag indexing

This commit is contained in:
Jean-Francois Dockes
2015-12-02 12:02:15 +01:00
parent a95dcbd4b0
commit 71672da7dd
3 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -26,6 +26,7 @@
#ifndef _WIN32
#include <sys/time.h>
#include <utime.h>
#define O_BINARY 0
#endif
#include <cstring>
@@ -43,7 +44,7 @@ bool copyfile(const char *src, const char *dst, string &reason, int flags)
int dfd = -1;
bool ret = false;
char buf[CPBSIZ];
int oflags = O_WRONLY|O_CREAT|O_TRUNC;
int oflags = O_WRONLY|O_CREAT|O_TRUNC|O_BINARY;
LOGDEB(("copyfile: %s to %s\n", src, dst));
@@ -96,7 +97,7 @@ bool stringtofile(const string& dt, const char *dst, string& reason,
LOGDEB(("stringtofile:\n"));
int dfd = -1;
bool ret = false;
int oflags = O_WRONLY|O_CREAT|O_TRUNC;
int oflags = O_WRONLY|O_CREAT|O_TRUNC|O_BINARY;
LOGDEB(("stringtofile: %u bytes to %s\n", (unsigned int)dt.size(), dst));