[Spice-commits] server/red-record-qxl.c server/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 26 12:52:36 UTC 2020


 server/red-record-qxl.c    |    2 +-
 server/tests/test-record.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b939e70d9c9cb5a366039a5f2407d431a4f291f7
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Feb 6 19:20:41 2020 +0000

    red-record-qxl: Write record file in the same format under Windows
    
    The record file uses fprintf to record commands and attributes.
    On Windows line terminator uses ASCII format ("\r\n") while on
    Linux it used UNIX format ("\n"). Open file as binary to use the
    same line terminator on both systems.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Francesco Giudici <fgiudici at redhat.com>

diff --git a/server/red-record-qxl.c b/server/red-record-qxl.c
index 6ae5f213..a19d0d25 100644
--- a/server/red-record-qxl.c
+++ b/server/red-record-qxl.c
@@ -838,7 +838,7 @@ RedRecord *red_record_new(const char *filename)
     FILE *f;
     RedRecord *record;
 
-    f = fopen(filename, "w+");
+    f = fopen(filename, "wb+");
     if (!f) {
         spice_error("failed to open recording file %s", filename);
     }
diff --git a/server/tests/test-record.c b/server/tests/test-record.c
index 8ee36ceb..66f408d6 100644
--- a/server/tests/test-record.c
+++ b/server/tests/test-record.c
@@ -62,7 +62,7 @@ test_record(bool compress)
     // check content of the output file
     FILE *f;
     if (!compress) {
-        f = fopen(fn, "r");
+        f = fopen(fn, "rb");
     } else {
         f = popen("gzip -dc < " OUTPUT_FILENAME, "r");
     }


More information about the Spice-commits mailing list