From 931dd74da6adf6b4230af71040e6db9e9c9f2b20 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:38:12 +0100 Subject: [PATCH] vfs: don't overwrite errno by a hard coded ENOENT Calling "open" in CHECK_AND_CALL sets a perfectly correct errno. There is no need to overwrite that with a value of ENOENT, since doing so hides lower level errors like EIO. Closes https://github.com/espressif/esp-idf/pull/8036 --- components/vfs/vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/vfs/vfs.c b/components/vfs/vfs.c index 9adafe2208..905c636af5 100644 --- a/components/vfs/vfs.c +++ b/components/vfs/vfs.c @@ -415,7 +415,7 @@ int esp_vfs_open(struct _reent *r, const char * path, int flags, int mode) __errno_r(r) = ENOMEM; return -1; } - __errno_r(r) = ENOENT; + __errno_r(r) = errno; return -1; }