Skip to content

Commit 8da744a

Browse files
authored
[exit] 修复_exit函数条件分支未覆盖所有情况的问题 (#6239)
attach #6229
1 parent c49c5a4 commit 8da744a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/libc/compilers/common/cstdlib.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ void __rt_libc_exit(int status)
2020

2121
if (self != RT_NULL)
2222
{
23+
LOG_W("thread:%s exit:%d!", self->name, status);
2324
#ifdef RT_USING_PTHREADS
2425
if(self->pthread_data != RT_NULL)
2526
{
2627
extern void pthread_exit(void *value);
2728
pthread_exit((void *)status);
2829
}
29-
#else
30-
LOG_E("thread:%s exit:%d!", self->name, status);
31-
rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
30+
else
3231
#endif
32+
{
33+
rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
34+
}
3335
}
3436
}
3537

0 commit comments

Comments
 (0)