summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-08-08 05:21:29 -0400
committerGitHub <[email protected]>2022-08-08 17:21:29 +0800
commit8da744a750a859213c66c29fcc618edde008866d (patch)
tree014b826b44a32b790ea493b894799948bb72f7d3 /components
parentc49c5a4d06598325015954623ff495dd7a4c56c9 (diff)
[exit] 修复_exit函数条件分支未覆盖所有情况的问题 (#6239)
attach #6229
Diffstat (limited to 'components')
-rw-r--r--components/libc/compilers/common/cstdlib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/libc/compilers/common/cstdlib.c b/components/libc/compilers/common/cstdlib.c
index 3ed5a228c8..55263011a9 100644
--- a/components/libc/compilers/common/cstdlib.c
+++ b/components/libc/compilers/common/cstdlib.c
@@ -20,16 +20,18 @@ void __rt_libc_exit(int status)
if (self != RT_NULL)
{
+ LOG_W("thread:%s exit:%d!", self->name, status);
#ifdef RT_USING_PTHREADS
if(self->pthread_data != RT_NULL)
{
extern void pthread_exit(void *value);
pthread_exit((void *)status);
}
-#else
- LOG_E("thread:%s exit:%d!", self->name, status);
- rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
+ else
#endif
+ {
+ rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
+ }
}
}