diff options
| author | [email protected] <[email protected]> | 2011-09-05 11:17:22 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-09-05 11:17:22 +0000 |
| commit | 446db862dd7bc374cefddb58268ed005e44b8421 (patch) | |
| tree | 7497b6c59cc4181bc5796c22f3c317da573f8612 /components/finsh | |
| parent | 2fe93c92245501fb0b3a3fd945a59cae56af0ca2 (diff) | |
fixed allocate node failed issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1694 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/finsh')
| -rw-r--r-- | components/finsh/cmd.c | 11 | ||||
| -rw-r--r-- | components/finsh/finsh_parser.c | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index 1b07358776..64fc0ad46f 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -164,7 +164,16 @@ static long _list_event(struct rt_list_node *list) for (node = list->next; node != list; node = node->next) { e = (struct rt_event*)(rt_list_entry(node, struct rt_object, list)); - rt_kprintf("%-8s 0x%08x %03d\n", e->parent.parent.name, e->set, rt_list_len(&e->parent.suspend_thread)); + if( !rt_list_isempty(&e->parent.suspend_thread) ) + { + rt_kprintf("%-8s 0x%08x %03d\n", e->parent.parent.name, e->set, rt_list_len(&e->parent.suspend_thread)); + show_wait_queue(&(e->parent.suspend_thread)); + rt_kprintf("\n"); + } + else + { + rt_kprintf("%-8s 0x%08x 0\n", e->parent.parent.name, e->set); + } } return 0; diff --git a/components/finsh/finsh_parser.c b/components/finsh/finsh_parser.c index 79b1492768..b4a19833cd 100644 --- a/components/finsh/finsh_parser.c +++ b/components/finsh/finsh_parser.c @@ -884,7 +884,7 @@ static struct finsh_node* make_sys_node(u_char type, struct finsh_node* node1, s node = finsh_node_allocate(type); - if (node1 != NULL) + if ((node1 != NULL) && (node != NULL)) { finsh_node_child(node) = node1; finsh_node_sibling(node1) = node2; |
