Merge pull request #4358 from mysterywolf/master

[libc] 优化abort函数
This commit is contained in:
Bernard Xiong
2021-02-20 12:15:49 +08:00
committed by GitHub
4 changed files with 11 additions and 28 deletions

View File

@@ -9,7 +9,6 @@
*/
#include <rtthread.h>
#include <stdlib.h>
void __rt_libc_exit(int status)
{
@@ -24,24 +23,12 @@ void __rt_libc_exit(int status)
if (self != RT_NULL)
{
if(status == EXIT_FAILURE) /* abort() */
{
rt_kprintf("thread:%s abort!\n", self->name);
}
else /* exit() */
{
rt_kprintf("thread:%s exit:%d!\n", self->name, status);
}
rt_kprintf("thread:%s exit:%d!\n", self->name, status);
rt_thread_suspend(self);
rt_schedule();
}
}
void __rt_libc_abort(void)
{
__rt_libc_exit(EXIT_FAILURE);
}
int __rt_libc_system(const char *string)
{
/* TODO */