56753ff
From d3e6c37f68e7e4573a47b0540f626a2add0d05e4 Mon Sep 17 00:00:00 2001
56753ff
From: Alon Levy <alevy@redhat.com>
56753ff
Date: Sun, 18 Mar 2012 13:46:13 +0100
56753ff
Subject: [PATCH 424/434] qxl: init_pipe_signaling: exit on failure
56753ff
56753ff
If pipe creation fails, exit, don't log and continue. Fix indentation at
56753ff
the same time.
56753ff
56753ff
Signed-off-by: Alon Levy <alevy@redhat.com>
56753ff
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
56753ff
---
56753ff
 hw/qxl.c |   21 +++++++++++----------
56753ff
 1 file changed, 11 insertions(+), 10 deletions(-)
56753ff
56753ff
diff --git a/hw/qxl.c b/hw/qxl.c
56753ff
index 73be115..9ad5807 100644
56753ff
--- a/hw/qxl.c
56753ff
+++ b/hw/qxl.c
56753ff
@@ -1453,16 +1453,17 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
56753ff
 
56753ff
 static void init_pipe_signaling(PCIQXLDevice *d)
56753ff
 {
56753ff
-   if (pipe(d->pipe) < 0) {
56753ff
-       dprint(d, 1, "%s: pipe creation failed\n", __FUNCTION__);
56753ff
-       return;
56753ff
-   }
56753ff
-   fcntl(d->pipe[0], F_SETFL, O_NONBLOCK);
56753ff
-   fcntl(d->pipe[1], F_SETFL, O_NONBLOCK);
56753ff
-   fcntl(d->pipe[0], F_SETOWN, getpid());
56753ff
-
56753ff
-   qemu_thread_get_self(&d->main);
56753ff
-   qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d);
56753ff
+    if (pipe(d->pipe) < 0) {
56753ff
+        fprintf(stderr, "%s:%s: qxl pipe creation failed\n",
56753ff
+                __FILE__, __func__);
56753ff
+        exit(1);
56753ff
+    }
56753ff
+    fcntl(d->pipe[0], F_SETFL, O_NONBLOCK);
56753ff
+    fcntl(d->pipe[1], F_SETFL, O_NONBLOCK);
56753ff
+    fcntl(d->pipe[0], F_SETOWN, getpid());
56753ff
+
56753ff
+    qemu_thread_get_self(&d->main);
56753ff
+    qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d);
56753ff
 }
56753ff
 
56753ff
 /* graphics console */
56753ff
-- 
56753ff
1.7.10
56753ff