net/virtio-user: fix return value not checked
[dpdk.git] / drivers / net / virtio / virtio_user / vhost_user.c
index 95e80f8..a159ece 100644 (file)
@@ -240,7 +240,7 @@ static const char * const vhost_msg_strings[] = {
 };
 
 int
-vhost_user_sock(int vhostfd, uint64_t req, void *arg)
+vhost_user_sock(int vhostfd, enum vhost_user_request req, void *arg)
 {
        struct vhost_user_msg msg;
        struct vhost_vring_file *file = 0;
@@ -392,7 +392,8 @@ vhost_user_setup(const char *path)
        }
 
        flag = fcntl(fd, F_GETFD);
-       fcntl(fd, F_SETFD, flag | FD_CLOEXEC);
+       if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0)
+               PMD_DRV_LOG(WARNING, "fcntl failed, %s", strerror(errno));
 
        memset(&un, 0, sizeof(un));
        un.sun_family = AF_UNIX;