extmod/vfs_lfsx: Fix errno value raised from chdir.

OSError errno values should be positive.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2025-05-13 12:54:47 +10:00
parent 4208970451
commit 62d26bfc15

View File

@@ -300,7 +300,7 @@ static mp_obj_t MP_VFS_LFSx(chdir)(mp_obj_t self_in, mp_obj_t path_in) {
struct LFSx_API (info) info;
int ret = LFSx_API(stat)(&self->lfs, path, &info);
if (ret < 0 || info.type != LFSx_MACRO(_TYPE_DIR)) {
mp_raise_OSError(-MP_ENOENT);
mp_raise_OSError(MP_ENOENT);
}
}