--- a/src/utils/copyfile.cpp
+++ b/src/utils/copyfile.cpp
@@ -26,6 +26,7 @@
#ifndef _WIN32
#include <sys/time.h>
#include <utime.h>
+#define O_BINARY 0
#endif
#include <cstring>
@@ -43,7 +44,7 @@
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 @@
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));