From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuzSI-0000PM-IT for qemu-devel@nongnu.org; Wed, 20 May 2015 04:34:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuzSF-0007Bn-4b for qemu-devel@nongnu.org; Wed, 20 May 2015 04:34:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuzSE-0007BR-UU for qemu-devel@nongnu.org; Wed, 20 May 2015 04:34:19 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4K8YI8W027100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 20 May 2015 04:34:18 -0400 From: Gerd Hoffmann Date: Wed, 20 May 2015 10:34:11 +0200 Message-Id: <1432110853-11399-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1432110853-11399-1-git-send-email-kraxel@redhat.com> References: <1432110853-11399-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 3/5] vnc: Don't assert if opening unix socket fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Cole Robinson From: Cole Robinson Reproducer: $ qemu-system-x86_64 -display vnc=unix:/root/i-cant-access-you.sock qemu-system-x86_64: iohandler.c:60: qemu_set_fd_handler2: Assertion `fd >= 0' failed. Aborted (core dumped) Signed-off-by: Cole Robinson Reviewed-by: Eric Blake Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index 076355d..fe4cd75 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3684,6 +3684,9 @@ void vnc_display_open(const char *id, Error **errp) /* listen for connects */ if (strncmp(vnc, "unix:", 5) == 0) { vs->lsock = unix_listen(vnc+5, NULL, 0, errp); + if (vs->lsock < 0) { + goto fail; + } vs->is_unix = true; } else { vs->lsock = inet_listen_opts(sopts, 5900, errp); -- 1.8.3.1