qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 1/3] vnc: Don't assert if opening unix socket fai


From: Cole Robinson
Subject: [Qemu-devel] [PATCH v3 1/3] vnc: Don't assert if opening unix socket fails
Date: Tue, 5 May 2015 11:07:17 -0400

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 <address@hidden>
---
v3:
    Fix checkpatch warning

 ui/vnc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/vnc.c b/ui/vnc.c
index 9f8ecd0..e1abf64 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3685,6 +3685,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);
-- 
2.4.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]