[Spice-devel] [PATCH xf86-video-qxl] Do not process watches on select() error.

Jeremy White jwhite at codeweavers.com
Wed May 27 11:58:25 PDT 2015


This enables a kill of an Xorg process to propogate further.
Without this, the read masks would be set, and we could end up
blocking in an accept() call and not exiting from the signal.

Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 src/spiceqxl_main_loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index 92579eb..ac9e43f 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -296,7 +296,7 @@ static void select_and_check_watches(void)
     watch = (SpiceWatch*)watches.next;
     timeout.tv_sec = timeout.tv_usec = 0;
     retval = select(max_fd + 1, &rfds, &wfds, NULL, &timeout);
-    if (retval) {
+    if (retval > 0) {
         RING_FOREACH_SAFE(link, next, &watches) {
             watch = (SpiceWatch*)link;
             if (!watch->remove && (watch->event_mask & SPICE_WATCH_EVENT_READ)
-- 
2.1.4



More information about the Spice-devel mailing list