From ed2a21e1c7ef6244b260d39255f259046081fcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?h=C3=B6rbert?= <55799864+winzkigermany@users.noreply.github.com> Date: Wed, 8 Dec 2021 11:43:18 +0100 Subject: [PATCH] Don't return a hard coded errno in vfs_fat_access Why should the return value of vfs_fat_access be hard coded as ENOENT? This hides errors like FR_DISK_ERR of the lower layers. --- components/fatfs/vfs/vfs_fat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;