verify: open state file in binary mode on Windows
authorVincent Fu <vincent.fu@samsung.com>
Thu, 14 Sep 2023 22:54:25 +0000 (18:54 -0400)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 14 Sep 2023 22:54:25 +0000 (18:54 -0400)
Make sure we open the verify state file in binary mode to avoid any
possible conversion of NL to CR+NL. This is the same fix we did for
1fb215e991d260a128e35d761f6850e8d9e4c333.

Fixes: https://github.com/axboe/fio/issues/1631
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
verify.c

index 2848b686123223fec6b76fd209dd2d7fd6b54970..f7355f3025681f723b949a5da404c8023f775456 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -1648,6 +1648,10 @@ static int open_state_file(const char *name, const char *prefix, int num,
        else
                flags = O_RDONLY;
 
+#ifdef _WIN32
+       flags |= O_BINARY;
+#endif
+
        verify_state_gen_name(out, sizeof(out), name, prefix, num);
 
        fd = open(out, flags, 0644);