From: Gerd Hoffmann <kra...@redhat.com>

Fixes file length discrepancies due to line ending conversions
on windows hosts.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3058
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
Message-ID: <20250811130110.820958-4-kra...@redhat.com>
(cherry picked from commit 040237436f423253f3397547aa78d449394dfbca)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>

diff --git a/hw/uefi/var-service-json.c b/hw/uefi/var-service-json.c
index ad3462cd15..f5f1556833 100644
--- a/hw/uefi/var-service-json.c
+++ b/hw/uefi/var-service-json.c
@@ -172,7 +172,7 @@ static GString *uefi_vars_to_json(uefi_vars_state *uv)
 void uefi_vars_json_init(uefi_vars_state *uv, Error **errp)
 {
     if (uv->jsonfile) {
-        uv->jsonfd = qemu_create(uv->jsonfile, O_RDWR, 0666, errp);
+        uv->jsonfd = qemu_create(uv->jsonfile, O_RDWR | O_BINARY, 0666, errp);
     }
 }
 
-- 
2.47.2


Reply via email to