DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ouyang Changchun <changchun.ouyang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] librte_vhost: Fix compilation issue
Date: Wed, 29 Oct 2014 14:39:38 +0800	[thread overview]
Message-ID: <1414564778-25056-1-git-send-email-changchun.ouyang@intel.com> (raw)

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

             reply	other threads:[~2014-10-29  6:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29  6:39 Ouyang Changchun [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414564778-25056-1-git-send-email-changchun.ouyang@intel.com \
    --to=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).