From 2ce5ce93972afcc9e8c6055b063cc888b1ada6af Mon Sep 17 00:00:00 2001 From: wangchen <253227059@qq.com> Date: Fri, 12 Aug 2022 08:53:13 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20littlefs=20readdir=E5=9C=A8=E5=AE=8C?= =?UTF-8?q?=E5=85=A8=E8=AF=BB=E5=AE=8C=E5=90=8E=EF=BC=8C=E4=BC=9A=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=94=99=E8=AF=AF=E7=A0=81EBADF=20=E3=80=90=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E3=80=91littlefs=20readdir=E5=9C=A8=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E8=AF=BB=E5=AE=8C=E5=90=8E=EF=BC=8C=E4=BC=9A=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81EBADF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 1, fsFops->readdir 执行返回非0时,有可能是正常情况,因此删除else赋值错误码 【影响】 对现有的产品编译不会有影响。 re #I5M1OE Signed-off-by: wangchen --- components/fs/vfs/vfs_fs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/fs/vfs/vfs_fs.c b/components/fs/vfs/vfs_fs.c index b48e4f6d..8a5e2331 100644 --- a/components/fs/vfs/vfs_fs.c +++ b/components/fs/vfs/vfs_fs.c @@ -709,8 +709,6 @@ static struct dirent *VfsReaddir(DIR *d) (dir->dMp->mFs->fsFops->readdir != NULL)) { if (dir->dMp->mFs->fsFops->readdir(dir, &dir->dDent) == 0) { ret = &dir->dDent; - } else { - VFS_ERRNO_SET(EBADF); } } else { VFS_ERRNO_SET(ENOTSUP);