[Spice-devel] [PATCH spice-server 20/33] replay: Force binary mode on input on Windows

Frediano Ziglio fziglio at redhat.com
Fri Dec 21 12:03:08 UTC 2018


If input contains the binary record we can't have it modified
during read.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/tests/replay.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/tests/replay.c b/server/tests/replay.c
index cbb1c195..c8e10d0a 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -392,6 +392,9 @@ int main(int argc, char **argv)
 
     if (strncmp(file[0], "-", 1) == 0) {
         fd = stdin;
+#ifdef _WIN32
+        _setmode(fileno(fd), _O_BINARY);
+#endif
     } else {
         fd = fopen(file[0], "r");
     }
-- 
2.17.2



More information about the Spice-devel mailing list