From d8c3b4d6463d4fb8ccd697b5ae9c6dd5903dbf88 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 6ec4ab6aa3..24a2f1ebc0 100644 --- a/components/vfs/vfs.c +++ b/components/vfs/vfs.c @@ -399,7 +399,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; }