summaryrefslogtreecommitdiffstats
path: root/contrib/vhost-user-input
diff options
context:
space:
mode:
authorMarc-André Lureau2019-06-05 16:58:26 +0200
committerMichael S. Tsirkin2019-06-16 22:16:52 +0200
commit24af03b946ce6889a435b2f3fc99daddde127874 (patch)
tree280c47099fe73c6fd2c0f3aac950b0a62f281de3 /contrib/vhost-user-input
parentvhost-user-gpu: do not send scanout update if no GPU socket (diff)
downloadqemu-24af03b946ce6889a435b2f3fc99daddde127874.tar.gz
qemu-24af03b946ce6889a435b2f3fc99daddde127874.tar.xz
qemu-24af03b946ce6889a435b2f3fc99daddde127874.zip
vhost-user: check unix_listen() return value
This check shouldn't be necessary, since &error_fatal is given as argument and will exit() on failure. However, this change should silence coverity CID 1401761 & 1401705. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190605145829.7674-3-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'contrib/vhost-user-input')
-rw-r--r--contrib/vhost-user-input/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
index 8d493f598e..8b854117f5 100644
--- a/contrib/vhost-user-input/main.c
+++ b/contrib/vhost-user-input/main.c
@@ -367,6 +367,10 @@ main(int argc, char *argv[])
if (opt_socket_path) {
int lsock = unix_listen(opt_socket_path, &error_fatal);
+ if (lsock < 0) {
+ g_printerr("Failed to listen on %s.\n", opt_socket_path);
+ exit(EXIT_FAILURE);
+ }
fd = accept(lsock, NULL, NULL);
close(lsock);
} else {