py/reader: Allow MICROPY_VFS_POSIX to work with MICROPY_READER_POSIX.

This commit is contained in:
Damien George 2018-06-06 13:12:05 +10:00
parent 8d82b0edbd
commit a93144cb65
1 changed files with 3 additions and 0 deletions

View File

@ -124,6 +124,8 @@ void mp_reader_new_file_from_fd(mp_reader_t *reader, int fd, bool close_fd) {
reader->close = mp_reader_posix_close;
}
#if !MICROPY_VFS_POSIX
// If MICROPY_VFS_POSIX is defined then this function is provided by the VFS layer
void mp_reader_new_file(mp_reader_t *reader, const char *filename) {
int fd = open(filename, O_RDONLY, 0644);
if (fd < 0) {
@ -131,5 +133,6 @@ void mp_reader_new_file(mp_reader_t *reader, const char *filename) {
}
mp_reader_new_file_from_fd(reader, fd, true);
}
#endif
#endif