diff mbox

[PATCHv3] async thread fix - handle EAGAIN/EINTR, remove fprintf

Message ID 1309348641-20061-3-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy June 29, 2011, 11:57 a.m. UTC
---
 hw/qxl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index 89e452e..3f84b0c 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1025,13 +1025,15 @@  static void *ioport_write_async(void *arg)
 
     while (true) {
         ret = read(d->aio_pipe[0], &io, sizeof(io));
+        if (ret < 0 && (errno == EAGAIN || errno == EINTR)) {
+            continue;
+        }
         if (ret != sizeof(io)) {
             break;
         }
         io_port = io->port;
         val = io->val;
 
-        fprintf(stderr, "%s: 0x%x\n", __FUNCTION__, io_port);
         switch (io_port) {
         case QXL_IO_UPDATE_AREA_ASYNC:
             qxl_spice_update_area(d, io->update_surface,