summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/stdlib.c
diff options
context:
space:
mode:
authorlizhirui <[email protected]>2021-05-18 09:54:11 +0800
committerlizhirui <[email protected]>2021-05-18 09:54:11 +0800
commit9a4e270f9770f778128ffdabe94f101416ce8c61 (patch)
tree9df43fbcc25c3f288ed6fdecd65909d4094d849f /components/libc/compilers/common/stdlib.c
parente7fc0c89d2367533dcd1b77e46acaeea7bc3f876 (diff)
parent4e9e3f79a565bb4fdc1d96deda18f9c771aeb0c9 (diff)
Merge branch 'RT-Thread:master' into master
Diffstat (limited to 'components/libc/compilers/common/stdlib.c')
-rw-r--r--components/libc/compilers/common/stdlib.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c
index b485bbd836..9d8952e99e 100644
--- a/components/libc/compilers/common/stdlib.c
+++ b/components/libc/compilers/common/stdlib.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -9,39 +9,18 @@
*/
#include <rtthread.h>
-#include <stdlib.h>
void __rt_libc_exit(int status)
{
rt_thread_t self = rt_thread_self();
-#ifdef RT_USING_MODULE
- if (dlmodule_self())
- {
- dlmodule_exit(status);
- }
-#endif
-
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_thread_suspend(self);
- rt_schedule();
+ rt_kprintf("thread:%s exit:%d!\n", self->name, status);
+ rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
}
}
-void __rt_libc_abort(void)
-{
- __rt_libc_exit(EXIT_FAILURE);
-}
-
int __rt_libc_system(const char *string)
{
/* TODO */