From 5164a6cc59a9ba83951ebbee014ca4d7e021fab5 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 4 Mar 2024 14:04:00 +0100 Subject: [PATCH] cpu/native: return _native_retval with NATIVE_AUTO_EXIT --- cpu/native/native_cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index 96956b74d3..8c4d81f0f2 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -184,8 +184,9 @@ void cpu_switch_context_exit(void) { #ifdef NATIVE_AUTO_EXIT if (sched_num_threads <= 1) { + extern unsigned _native_retval; DEBUG("cpu_switch_context_exit: last task has ended. exiting.\n"); - real_exit(EXIT_SUCCESS); + real_exit(_native_retval); } #endif