Skip to content
Snippets Groups Projects
Commit 24af03b9 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Michael S. Tsirkin
Browse files

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: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190605145829.7674-3-marcandre.lureau@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 1e40d198
No related branches found
No related tags found
No related merge requests found
......@@ -1160,6 +1160,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 {
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment