From 2d7f58d1659168d196ea90cc92f30d7e27e7a92d Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 31 Jul 2020 02:50:17 +0800 Subject: [PATCH] net/procfs: Support chdir("/proc/net/") correctly Signed-off-by: Xiang Xiao 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 b3481fc728..64aa3adab7 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; }