Skip to contentSkip to conversation

spice: fix spice_chr_add_watch() pre-condition

PATCH New Marc-André Lureau 1 participant 1 message May 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spice: fix spice_chr_add_watch() pre-condition

Since e02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3, add_watch() is called with G_IO_HUP. Even if spice-qemu-char ignores this flag, the precondition must be changed.

https://bugzilla.redhat.com/show_bug.cgi?id=1128992

---
 spice-qemu-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
spice-qemu-char.c +1 -1
index a4f4e57..4199bc2 100644
@@ -169,7 +169,7 @@ static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond)
     SpiceCharDriver *scd = chr->opaque;
     SpiceCharSource *src;
 
-    assert(cond == G_IO_OUT);
+    assert(cond & G_IO_OUT);
 
     src = (SpiceCharSource *)g_source_new(&SpiceCharSourceFuncs,
                                           sizeof(SpiceCharSource));
Signature · 1 line
2.1.0