diff options
Diffstat (limited to 'ports/unix/modtime.c')
| -rw-r--r-- | ports/unix/modtime.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ports/unix/modtime.c b/ports/unix/modtime.c index 78068b35d..aeeece546 100644 --- a/ports/unix/modtime.c +++ b/ports/unix/modtime.c @@ -117,10 +117,16 @@ STATIC mp_obj_t mod_time_sleep(mp_obj_t arg) { } RAISE_ERRNO(res, errno); #else - // TODO: Handle EINTR - MP_THREAD_GIL_EXIT(); - sleep(mp_obj_get_int(arg)); - MP_THREAD_GIL_ENTER(); + int seconds = mp_obj_get_int(arg); + for (;;) { + MP_THREAD_GIL_EXIT(); + seconds = sleep(seconds); + MP_THREAD_GIL_ENTER(); + if (seconds == 0) { + break; + } + mp_handle_pending(true); + } #endif return mp_const_none; } |
