From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9cg1-0003Hd-1O for qemu-devel@nongnu.org; Mon, 19 Mar 2012 09:31:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9cfa-00053c-VP for qemu-devel@nongnu.org; Mon, 19 Mar 2012 09:31:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9cfa-000536-ND for qemu-devel@nongnu.org; Mon, 19 Mar 2012 09:30:42 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2JDUfr0028538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 09:30:41 -0400 From: Gerd Hoffmann Date: Mon, 19 Mar 2012 14:30:34 +0100 Message-Id: <1332163838-1587-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1332163838-1587-1-git-send-email-kraxel@redhat.com> References: <1332163838-1587-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 3/7] qxl: init_pipe_signaling: exit on failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alon Levy , Gerd Hoffmann From: Alon Levy If pipe creation fails, exit, don't log and continue. Fix indentation at the same time. Signed-off-by: Alon Levy Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index e17b0e3..26ca893 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1452,16 +1452,17 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events) static void init_pipe_signaling(PCIQXLDevice *d) { - if (pipe(d->pipe) < 0) { - dprint(d, 1, "%s: pipe creation failed\n", __FUNCTION__); - return; - } - fcntl(d->pipe[0], F_SETFL, O_NONBLOCK); - fcntl(d->pipe[1], F_SETFL, O_NONBLOCK); - fcntl(d->pipe[0], F_SETOWN, getpid()); - - qemu_thread_get_self(&d->main); - qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d); + if (pipe(d->pipe) < 0) { + fprintf(stderr, "%s:%s: qxl pipe creation failed\n", + __FILE__, __func__); + exit(1); + } + fcntl(d->pipe[0], F_SETFL, O_NONBLOCK); + fcntl(d->pipe[1], F_SETFL, O_NONBLOCK); + fcntl(d->pipe[0], F_SETOWN, getpid()); + + qemu_thread_get_self(&d->main); + qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d); } /* graphics console */ -- 1.7.1