DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] librte_vhost: Fix compilation issue
@ 2014-10-29  6:39 Ouyang Changchun
  2014-10-29  8:16 ` Fu, JingguoX
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ouyang Changchun @ 2014-10-29  6:39 UTC (permalink / raw)
  To: dev

It fixes this compilation complain: "error: ignoring return value of 'realpath', 
declared with attribute warn_unused_result [-Werror=unused-result]"

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
 lib/librte_vhost/virtio-net.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index 27ba175..8015dd8 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -133,6 +133,7 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,
 	char mapfile[PATH_MAX];
 	char procdir[PATH_MAX];
 	char resolved_path[PATH_MAX];
+	char *path = NULL;
 	FILE		*fmap;
 	void		*map;
 	uint8_t		found = 0;
@@ -235,9 +236,11 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,
 	while (NULL != (dptr = readdir(dp))) {
 		snprintf(memfile, PATH_MAX, "/proc/%u/fd/%s",
 				pid, dptr->d_name);
-	    realpath(memfile, resolved_path);
-		if (resolved_path == NULL) {
-			RTE_LOG(ERR, VHOST_CONFIG, "(%"PRIu64") Failed to resolve fd directory\n", dev->device_fh);
+		path = realpath(memfile, resolved_path);
+		if (path == NULL) {
+			RTE_LOG(ERR, VHOST_CONFIG,
+				"(%"PRIu64") Failed to resolve fd directory\n",
+				dev->device_fh);
 			closedir(dp);
 			return -1;
 		}
-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-30  0:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29  6:39 [dpdk-dev] [PATCH] librte_vhost: Fix compilation issue Ouyang Changchun
2014-10-29  8:16 ` Fu, JingguoX
2014-10-29  8:48 ` Fu, JingguoX
2014-10-29 23:07   ` Thomas Monjalon
2014-10-29 23:21 ` Thomas Monjalon
2014-10-30  0:33   ` Ouyang, Changchun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).