summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-22 16:17:25 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-22 16:17:25 -0500
commitff91f4e0b5a26e19932cbc61491f68f094a17685 (patch)
tree8138e72649954e2a9021c268c8dbb4e542615989
parentbe883c2f64a5efed223c1d1ab30d9e61a30867e2 (diff)
lookup_task.c: Fix bug where only first four chars of name mattered
-rw-r--r--schedsim/shell/shared/lookup_task.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/schedsim/shell/shared/lookup_task.c b/schedsim/shell/shared/lookup_task.c
index 79d5717..e70eb4d 100644
--- a/schedsim/shell/shared/lookup_task.c
+++ b/schedsim/shell/shared/lookup_task.c
@@ -23,6 +23,7 @@
#endif
#ifndef RTEMS_IDENT_NAME
#define RTEMS_IDENT_NAME rtems_task_ident
+ #define DOING_TASKS
#endif
int METHOD_NAME(
@@ -35,9 +36,14 @@ int METHOD_NAME(
unsigned long tmp;
if ( string[0] != '0' ) {
- if ( !strcmp( string, "SELF" ) ) {
- *id = _Thread_Executing->Object.id;
- return 0;
+ #ifdef DOING_TASKS
+ if ( !strcmp( string, "SELF" ) ) {
+ *id = _Thread_Executing->Object.id;
+ return 0;
+ }
+ #endif
+ if ( strlen( string ) != 4 ) {
+ return -1;
}
memset( name, '\0', sizeof(name) );
strncpy( name, string, 4 );