1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Merge pull request #20419 from benpicco/cpu/native_assert-reval

cpu/native: return error code on failed assertion
This commit is contained in:
Marian Buschsieweke 2024-02-22 16:31:51 +00:00 committed by GitHub
commit 047fb8d3c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,7 @@
* @author Oliver Hahm <oliver.hahm@inria.fr>
*/
#include <errno.h>
#include <unistd.h>
#include <signal.h>
@ -25,6 +26,9 @@
void panic_arch(void)
{
extern unsigned _native_retval;
_native_retval = EINVAL;
#ifdef DEVELHELP
/* since we're atop an Unix-like platform,
just use the (developer-)friendly core-dump feature */

View File

@ -36,6 +36,8 @@
#define ENABLE_DEBUG 0
#include "debug.h"
unsigned _native_retval = EXIT_SUCCESS;
static void _native_sleep(void)
{
_native_in_syscall++; /* no switching here */
@ -75,7 +77,7 @@ void pm_off(void)
extern void auto_unmount_vfs(void);
auto_unmount_vfs();
#endif
real_exit(EXIT_SUCCESS);
real_exit(_native_retval);
}
void pm_reboot(void)