diff --git a/core/embed/unix/common.c b/core/embed/unix/common.c index 5fa20d347..7ca86f500 100644 --- a/core/embed/unix/common.c +++ b/core/embed/unix/common.c @@ -29,7 +29,7 @@ extern void main_clean_exit(); void __shutdown(void) { printf("SHUTDOWN\n"); - main_clean_exit(); + main_clean_exit(3); } #define COLOR_FATAL_ERROR RGB16(0x7F, 0x00, 0x00) diff --git a/core/embed/unix/main.c b/core/embed/unix/main.c index 0d24c668e..22956bad2 100644 --- a/core/embed/unix/main.c +++ b/core/embed/unix/main.c @@ -405,16 +405,16 @@ STATIC void set_sys_argv(char *argv[], int argc, int start_arg) { } } -void main_clean_exit() { +void main_clean_exit(int status) { fflush(stdout); fflush(stderr); mp_obj_t sys_exit = mp_obj_dict_get(mp_module_sys.globals, MP_ROM_QSTR(MP_QSTR_exit)); if (mp_obj_is_callable(sys_exit)) { - mp_call_function_1(MP_OBJ_TO_PTR(sys_exit), MP_OBJ_NEW_SMALL_INT(3)); + mp_call_function_1(MP_OBJ_TO_PTR(sys_exit), MP_OBJ_NEW_SMALL_INT(status)); } // sys.exit shouldn't return so force exit in case it does. - exit(3); + exit(status); } #ifdef _WIN32