diff options
| author | sheltonyu <[email protected]> | 2021-04-13 11:37:46 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-13 11:37:46 +0800 |
| commit | 46c5ba9225702bf473646ec2f4200c9560e2db90 (patch) | |
| tree | a7fe59ac9ce9a6a1c90d9c81324a4a6bb91b38a4 /components/libc/compilers/common/stdlib.c | |
| parent | 35ef1f9e0fcf1ae881a83558dbf7334ab08c598e (diff) | |
| parent | c44e5165bef5b7b069eb99a4f027454f417a726b (diff) | |
Merge branch 'master' into developer
Diffstat (limited to 'components/libc/compilers/common/stdlib.c')
| -rw-r--r-- | components/libc/compilers/common/stdlib.c | 27 |
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 */ |
