aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio/virtio_user/vhost_user.c
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:30:06 -0300
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-07-19 08:26:18 +0200
commit8be94df6e9f5f70516cb86d82dd04fefaa0fe8b3 (patch)
treeb055d508e145ddc35943c4a083aa846855c92732 /drivers/net/virtio/virtio_user/vhost_user.c
parentddb3f4884bd4cdb8659fb8326c27986a5c832ade (diff)
Imported Upstream version 16.07-rc2
Change-Id: Ie9e8ec528a2a0dace085c5e44aa7fa3b489d4ba0 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/virtio/virtio_user/vhost_user.c')
-rw-r--r--drivers/net/virtio/virtio_user/vhost_user.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index a2b0687f..082e8217 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -181,7 +181,7 @@ get_hugepage_file_info(struct hugepage_file_info huges[], int max)
}
huges[idx].addr = v_start;
huges[idx].size = v_end - v_start;
- strcpy(huges[idx].path, tmp);
+ snprintf(huges[idx].path, PATH_MAX, "%s", tmp);
idx++;
}
@@ -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;