You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/08/03 20:00:31 UTC

[incubator-nuttx] 01/03: net/procfs: Support chdir("/proc/net/") correctly

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2d7f58d1659168d196ea90cc92f30d7e27e7a92d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Jul 31 02:50:17 2020 +0800

    net/procfs: Support chdir("/proc/net/") correctly
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
    Change-Id: I47295019c6054c869545e33258ad3460896e851a
---
 net/procfs/net_procfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/procfs/net_procfs.c b/net/procfs/net_procfs.c
index b3481fc..64aa3ad 100644
--- a/net/procfs/net_procfs.c
+++ b/net/procfs/net_procfs.c
@@ -660,7 +660,7 @@ static int netprocfs_stat(FAR const char *relpath, FAR struct stat *buf)
 {
   /* Check for the directory "net" */
 
-  if (strcmp(relpath, "net") == 0)
+  if (strcmp(relpath, "net") == 0 || strcmp(relpath, "net/") == 0)
     {
       buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
     }