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

Marc-André Lureau marcandre.lureau at gmail.com
Sat Dec 22 10:17:32 UTC 2018


On Fri, Dec 21, 2018 at 4:04 PM Frediano Ziglio <fziglio at redhat.com> wrote:
>
> If input contains the binary record we can't have it modified
> during read.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Or the more portable
freopen(NULL, "rb", stdin);?

anyway
Reviewed-by: Marc-André Lureau <marcandre.lureau 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
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



--
Marc-André Lureau


More information about the Spice-devel mailing list