diff options
author | Dave Barach <dave@barachs.net> | 2017-01-18 10:23:22 -0500 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2017-01-18 10:32:15 -0500 |
commit | 8f544964a3df144a441b136c2a01427eca731eea (patch) | |
tree | 90f9eca233c2b12c8d1f96c0a27e617053c6e99e /src/vnet/devices/virtio/vhost-user.c | |
parent | d8e478762919b5d40529d72edd3ff8a85fbe9800 (diff) |
Fix coverity warnings, VPP-608
Change-Id: Ib0144ba3a9a09971d3946c932e8fed6d5c1ad278
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/devices/virtio/vhost-user.c')
-rw-r--r-- | src/vnet/devices/virtio/vhost-user.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c index 9a7c1dc0832..ac14286747a 100644 --- a/src/vnet/devices/virtio/vhost-user.c +++ b/src/vnet/devices/virtio/vhost-user.c @@ -2326,12 +2326,16 @@ vhost_user_process (vlib_main_t * vm, sizeof (sun.sun_path) - 1); /* Avoid hanging VPP if the other end does not accept */ - fcntl(sockfd, F_SETFL, O_NONBLOCK); + if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + clib_unix_warning ("fcntl"); + if (connect (sockfd, (struct sockaddr *) &sun, sizeof (struct sockaddr_un)) == 0) { /* Set the socket to blocking as it was before */ - fcntl(sockfd, F_SETFL, 0); + if (fcntl(sockfd, F_SETFL, 0) < 0) + clib_unix_warning ("fcntl2"); + vui->sock_errno = 0; template.file_descriptor = sockfd; template.private_data = |