We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ab2f3f commit d974ee1Copy full SHA for d974ee1
1 file changed
extmod/vfs_posix.c
@@ -192,17 +192,22 @@ STATIC mp_obj_t vfs_posix_ilistdir_it_iternext(mp_obj_t self_in) {
192
}
193
194
#ifdef _DIRENT_HAVE_D_TYPE
195
+ #ifdef DTTOIF
196
+ t->items[1] = MP_OBJ_NEW_SMALL_INT(DTTOIF(dirent->d_type));
197
+ #else
198
if (dirent->d_type == DT_DIR) {
199
t->items[1] = MP_OBJ_NEW_SMALL_INT(MP_S_IFDIR);
200
} else if (dirent->d_type == DT_REG) {
201
t->items[1] = MP_OBJ_NEW_SMALL_INT(MP_S_IFREG);
202
} else {
203
t->items[1] = MP_OBJ_NEW_SMALL_INT(dirent->d_type);
204
205
+ #endif
206
#else
207
// DT_UNKNOWN should have 0 value on any reasonable system
208
t->items[1] = MP_OBJ_NEW_SMALL_INT(0);
209
#endif
210
+
211
#ifdef _DIRENT_HAVE_D_INO
212
t->items[2] = MP_OBJ_NEW_SMALL_INT(dirent->d_ino);
213
0 commit comments