diff --git a/components/libc/compilers/common/cstdlib.c b/components/libc/compilers/common/cstdlib.c index 3ed5a228c83bbd8b8b1423a1f56adc1875e1f80d..55263011a99d4a957a98971507b800c4b911f183 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); + } } }