aboutsummaryrefslogtreecommitdiff
path: root/tool/sqlite3_rsync.c
diff options
context:
space:
mode:
authordrh <>2024-10-22 10:29:13 +0000
committerdrh <>2024-10-22 10:29:13 +0000
commit8f90c664071ac0abc6611c6294570d5890d72e5f (patch)
tree7b013b7a455e3b9b5a371fd4632ca16aab3ced7e /tool/sqlite3_rsync.c
parent49f293ba581fc54f14348c01114ecf1ff95df26c (diff)
downloadsqlite-8f90c664071ac0abc6611c6294570d5890d72e5f.tar.gz
sqlite-8f90c664071ac0abc6611c6294570d5890d72e5f.zip
Further changes to sqlite3_rsync.c to work around Windows issues.
FossilOrigin-Name: e2bd3219d9f7bab377ebcfa9a737ca59899c68dad1e3d1d16347bbfdd25652ee
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;
}