summaryrefslogtreecommitdiff
path: root/unix/modos.c
diff options
context:
space:
mode:
authorMarcus von Appen <marcus@sysfault.org>2014-06-07 09:50:18 +0200
committerMarcus von Appen <marcus@sysfault.org>2014-06-07 09:50:18 +0200
commit585a3394df2bbfa863af619a5ea8a1d5a7b88266 (patch)
tree87a255f091993e4eee2789d7ad5776d456217d2a /unix/modos.c
parentc61be8e1e10a8c7bac3161cae531d26a9d754825 (diff)
- Cast the struct stat sb.st_ino field to machine_int_t explicitly to avoid a
cast error in MP_OBJ_NEW_SMALL_INT(). This is necessary for FreeBSD, where st_ino is of different size - If MP_CLOCKS_PER_SEC is defined on the target host, simply define CLOCK_DIV as a fraction, regardless of the value of MP_CLOCKS_PER_SEC. FreeBSD uses a non-POSIX compliant value of 128 for CLOCKS_PER_SEC
Diffstat (limited to 'unix/modos.c')
-rw-r--r--unix/modos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/modos.c b/unix/modos.c
index a6be4bfff..657958d04 100644
--- a/unix/modos.c
+++ b/unix/modos.c
@@ -52,7 +52,7 @@ STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) {
mp_obj_tuple_t *t = mp_obj_new_tuple(10, NULL);
t->items[0] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_mode);
- t->items[1] = MP_OBJ_NEW_SMALL_INT(sb.st_ino);
+ t->items[1] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_ino);
t->items[2] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_dev);
t->items[3] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_nlink);
t->items[4] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_uid);