diff options
| author | Dan Halbert <halbert@halwitz.org> | 2020-02-04 16:19:40 -0500 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2020-02-04 16:19:40 -0500 |
| commit | 5164719e67878418cff51d26f40e4813da02bc83 (patch) | |
| tree | 61ce839ea0b9364d05604fc9cad948bfb082c9f6 /extmod | |
| parent | 57b566e73614c74a9fc74cd2d2007d91cdb507db (diff) | |
preserve errno in OSError
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/vfs_fat_file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index dc0a893a5..422f057a8 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -28,6 +28,7 @@ #if MICROPY_VFS && MICROPY_VFS_FAT #include <stdio.h> +#include <string.h> #include "py/runtime.h" #include "py/stream.h" @@ -199,7 +200,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar FRESULT res = f_open(&vfs->fatfs, &o->fp, fname, mode); if (res != FR_OK) { m_del_obj(pyb_file_obj_t, o); - mp_raise_OSError_errno_str(fresult_to_errno_table[res], fname); + mp_raise_OSError_errno_str(fresult_to_errno_table[res], args[0].u_obj); } // If we're reading, turn on fast seek. if (mode == FA_READ) { |
