aboutsummaryrefslogtreecommitdiff
path: root/tool/sqlite3_rsync.c
diff options
context:
space:
mode:
Diffstat (limited to 'tool/sqlite3_rsync.c')
-rw-r--r--tool/sqlite3_rsync.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tool/sqlite3_rsync.c b/tool/sqlite3_rsync.c
index 9f7c302cb..7a453b6cc 100644
--- a/tool/sqlite3_rsync.c
+++ b/tool/sqlite3_rsync.c
@@ -93,6 +93,7 @@ struct SQLiteRsync {
****************************************************************************/
#ifdef _WIN32
#include <windows.h>
+#include <io.h>
#include <fcntl.h>
/*
** Print a fatal error and quit.
@@ -1756,6 +1757,10 @@ int main(int argc, char const * const *argv){
ctx.pIn = stdin;
ctx.pOut = stdout;
ctx.isRemote = 1;
+#ifdef _WIN32
+ _setmode(_fileno(ctx.pIn), _O_BINARY);
+ _setmode(_fileno(ctx.pOut), _O_BINARY);
+#endif
originSide(&ctx);
return 0;
}
@@ -1763,6 +1768,10 @@ int main(int argc, char const * const *argv){
ctx.pIn = stdin;
ctx.pOut = stdout;
ctx.isRemote = 1;
+#ifdef _WIN32
+ _setmode(_fileno(ctx.pIn), _O_BINARY);
+ _setmode(_fileno(ctx.pOut), _O_BINARY);
+#endif
replicaSide(&ctx);
return 0;
}