Re: [PATCH 1/2] replay: fix check for QXL_SURF_FLAG_KEEP_DATA flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Tue, Aug 25, 2015 at 11:43 AM, Frediano Ziglio <fziglio@xxxxxxxxxx> wrote:
A logical and (&&) was used instead of a bit one (&).
Was working just as is the only flag defined.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/red_record_qxl.c | 2 +-
 server/red_replay_qxl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/red_record_qxl.c b/server/red_record_qxl.c
index d96fb79..b35b462 100644
--- a/server/red_record_qxl.c
+++ b/server/red_record_qxl.c
@@ -724,7 +724,7 @@ static void red_record_surface_cmd(FILE *fd, RedMemSlotInfo *slots, int group_id
         fprintf(fd, "u.surface_create.height %d\n", qxl->u.surface_create.height);
         fprintf(fd, "u.surface_create.stride %d\n", qxl->u.surface_create.stride);
         size = qxl->u.surface_create.height * abs(qxl->u.surface_create.stride);
-        if (qxl->flags && QXL_SURF_FLAG_KEEP_DATA) {
+        if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
             write_binary(fd, "data", size,
                 (uint8_t*)get_virt(slots, qxl->u.surface_create.data, size, group_id,
                                    &error));
diff --git a/server/red_replay_qxl.c b/server/red_replay_qxl.c
index a010a58..5044adf 100644
--- a/server/red_replay_qxl.c
+++ b/server/red_replay_qxl.c
@@ -1025,7 +1025,7 @@ static QXLSurfaceCmd *red_replay_surface_cmd(SpiceReplay *replay)
         replay_fscanf(replay, "u.surface_create.height %d\n", &qxl->u.surface_create.height);
         replay_fscanf(replay, "u.surface_create.stride %d\n", &qxl->u.surface_create.stride);
         size = qxl->u.surface_create.height * abs(qxl->u.surface_create.stride);
-        if (qxl->flags && QXL_SURF_FLAG_KEEP_DATA) {
+        if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
             read_binary(replay, "data", &read_size, (uint8_t**)&qxl->u.surface_create.data, 0);
             if (read_size != size) {
                 spice_printerr("mismatch %ld != %ld", size, read_size);
--
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


ACK!
--
Fabiano Fidêncio
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]