diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-05-22 16:17:25 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-05-22 16:17:25 -0500 |
commit | ff91f4e0b5a26e19932cbc61491f68f094a17685 (patch) | |
tree | 8138e72649954e2a9021c268c8dbb4e542615989 | |
parent | cpus4_affinity_case1.scen: Add error checking (diff) | |
download | rtems-schedsim-ff91f4e0b5a26e19932cbc61491f68f094a17685.tar.bz2 |
lookup_task.c: Fix bug where only first four chars of name mattered
-rw-r--r-- | schedsim/shell/shared/lookup_task.c | 12 |
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 ); |