From 3386477b297251c0ba83e6cf13fe9aaddcac57fa Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 16 Dec 2015 13:21:09 +0000 Subject: [PATCH] unix/modos: Allow to configure use of d_ino using _DIRENT_HAVE_D_INO. Ports will need to #define _DIRENT_HAVE_D_INO (0) to disable d_ino use. --- unix/modos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/modos.c b/unix/modos.c index 9293d59d0f..83b24c05c3 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -184,7 +184,11 @@ STATIC mp_obj_t listdir_next(mp_obj_t self_in) { // DT_UNKNOWN should have 0 value on any reasonable system t->items[1] = 0; #endif + #if !defined(_DIRENT_HAVE_D_INO) || _DIRENT_HAVE_D_INO t->items[2] = MP_OBJ_NEW_SMALL_INT(dirent->d_ino); + #else + t->items[1] = MP_OBJ_NEW_SMALL_INT(0); + #endif return MP_OBJ_FROM_PTR(t); }