From: Ouyang Changchun <changchun.ouyang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue
Date: Mon, 3 Nov 2014 16:11:53 +0800 [thread overview]
Message-ID: <1415002313-15661-1-git-send-email-changchun.ouyang@intel.com> (raw)
Commit aec8283d47d4e4366b6 fixes the compilation issue, but it leads to
one runtime issue: early exit wrongly. In some case, 'path' is NULL, but
'resolved_path' has effective path, it should continue going ahead rather
than exit.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
lib/librte_vhost/virtio-net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index 8015dd8..3fa1274 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -237,7 +237,7 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,
snprintf(memfile, PATH_MAX, "/proc/%u/fd/%s",
pid, dptr->d_name);
path = realpath(memfile, resolved_path);
- if (path == NULL) {
+ if ((path == NULL) && (strlen(resolved_path) == 0)) {
RTE_LOG(ERR, VHOST_CONFIG,
"(%"PRIu64") Failed to resolve fd directory\n",
dev->device_fh);
--
1.8.4.2
next reply other threads:[~2014-11-03 8:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 8:11 Ouyang Changchun [this message]
2014-11-06 2:38 ` Xie, Huawei
2014-11-06 5:20 ` Ouyang, Changchun
2014-11-06 20:47 ` Xie, Huawei
2014-11-06 20:53 ` Xie, Huawei
2014-11-06 22:13 ` Thomas Monjalon
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=1415002313-15661-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).