summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/stdlib.c
diff options
context:
space:
mode:
authorguo <[email protected]>2021-09-28 10:36:54 +0800
committerGitHub <[email protected]>2021-09-28 10:36:54 +0800
commit55a302cd092758a44b589d65470a69d9e8ae4ced (patch)
treee60fc53994c426007e9eb4877e5bd123f124ef39 /components/libc/compilers/common/stdlib.c
parent00727d6b6db92dc1cf98f028f26fd6168594b905 (diff)
parent00d42ef73cff61ecda7ff006b077a73e1a4ff669 (diff)
Merge branch 'master' into usbh_construct
Diffstat (limited to 'components/libc/compilers/common/stdlib.c')
-rw-r--r--components/libc/compilers/common/stdlib.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c
index 9f801ab966..16a13afb83 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
*
@@ -10,27 +10,26 @@
#include <rtthread.h>
+#define DBG_TAG "stdlib"
+#define DBG_LVL DBG_INFO
+#include <rtdbg.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)
{
- rt_kprintf("thread:%s exit:%d!\n", self->name, status);
- rt_thread_suspend(self);
- rt_schedule();
+ LOG_E("thread:%s exit:%d!", self->name, status);
+ rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
}
}
int __rt_libc_system(const char *string)
{
- /* TODO */
+#ifdef RT_USING_MSH
+ extern int msh_exec(char *cmd, rt_size_t length);
+ msh_exec((char*)string, rt_strlen(string));
+#endif
return 0;
}