dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] librte_vhost: Fix the path test issue
@ 2014-11-03  8:11 Ouyang Changchun
       [not found] ` <1415002313-15661-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Ouyang Changchun @ 2014-11-03  8:11 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 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

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

end of thread, other threads:[~2014-11-06 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03  8:11 [PATCH] librte_vhost: Fix the path test issue Ouyang Changchun
     [not found] ` <1415002313-15661-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-06  2:38   ` Xie, Huawei
     [not found]     ` <C37D651A908B024F974696C65296B57B0F2E28C3-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-06  5:20       ` Ouyang, Changchun
     [not found]         ` <F52918179C57134FAEC9EA62FA2F9625118818BA-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-06 20:47           ` Xie, Huawei
2014-11-06 20:53   ` Xie, Huawei
     [not found]     ` <C37D651A908B024F974696C65296B57B0F2E3828-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-06 22:13       ` Thomas Monjalon

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).