[Spice-devel] [PATCH 01/15] dc: convert to infinite loop

Frediano Ziglio fziglio at redhat.com
Mon May 16 16:40:26 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/display-channel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index 1f4d66f..171dfce 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -512,7 +512,10 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
                 dcc = SPICE_CONTAINEROF(worker_ring_item, DisplayChannelClient,
                                         common.base.channel_link);
                 dpi = SPICE_CONTAINEROF(dpi_ring_item, RedDrawablePipeItem, base);
-                while (worker_ring_item && (!dpi || dcc != dpi->dcc)) {
+                for (;;) {
+                    if (!worker_ring_item || (dpi && dcc == dpi->dcc)) {
+                        break;
+                    }
                     dcc_prepend_drawable(dcc, drawable);
                     worker_ring_item = ring_next(&RED_CHANNEL(display)->clients,
                                                  worker_ring_item);
-- 
2.7.4



More information about the Spice-devel mailing list