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>
This commit is contained in:
parent
1e40d19877
commit
24af03b946
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user