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:
@@ -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;
|
struct LFSx_API (info) info;
|
||||||
int ret = LFSx_API(stat)(&self->lfs, path, &info);
|
int ret = LFSx_API(stat)(&self->lfs, path, &info);
|
||||||
if (ret < 0 || info.type != LFSx_MACRO(_TYPE_DIR)) {
|
if (ret < 0 || info.type != LFSx_MACRO(_TYPE_DIR)) {
|
||||||
mp_raise_OSError(-MP_ENOENT);
|
mp_raise_OSError(MP_ENOENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user