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; }