8000 unix/file: Use generic stream flush() method. · sparkfun/circuitpython@64da62e · GitHub
[go: up one dir, main page]

Skip to content

Commit 64da62e

Browse files
committed
unix/file: Use generic stream flush() method.
1 parent aa4ada9 commit 64da62e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

unix/file.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,6 @@ STATIC mp_uint_t fdfile_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, i
129129
}
130130
}
131131

132-
STATIC mp_obj_t fdfile_flush(mp_obj_t self_in) {
133-
mp_obj_fdfile_t *self = MP_OBJ_TO_PTR(self_in);
134-
check_fd_is_open(self);
135-
fsync(self->fd);
136-
return mp_const_none;
137-
}
138-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_flush_obj, fdfile_flush);
139-
140132
STATIC mp_obj_t fdfile_close(mp_obj_t self_in) {
141133
mp_obj_fdfile_t *self = MP_OBJ_TO_PTR(self_in);
142134
close(self->fd);
@@ -237,7 +229,7 @@ STATIC const mp_rom_map_elem_t rawfile_locals_dict_table[] = {
237229
{ MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },
238230
{ MP_ROM_QSTR(MP_QSTR_seek), MP_ROM_PTR(&mp_stream_seek_obj) },
239231
{ MP_ROM_QSTR(MP_QSTR_tell), MP_ROM_PTR(&mp_stream_tell_obj) },
240-
{ MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&fdfile_flush_obj) },
232+
{ MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&mp_stream_flush_obj) },
241233
{ MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&fdfile_close_obj) },
242234
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&mp_identity_obj) },
243235
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&fdfile___exit___obj) },

0 commit comments

Comments
 (0)
0