diff --git a/components/fatfs/vfs/vfs_fat.c b/components/fatfs/vfs/vfs_fat.c index 37e060abcd..e797244a09 100644 --- a/components/fatfs/vfs/vfs_fat.c +++ b/components/fatfs/vfs/vfs_fat.c @@ -865,7 +865,7 @@ static int vfs_fat_access(void* ctx, const char *path, int amode) // it exists then it is readable and executable } else { ret = -1; - errno = ENOENT; + errno = fresult_to_errno(res); } return ret;