From ff91f4e0b5a26e19932cbc61491f68f094a17685 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 22 May 2014 16:17:25 -0500 Subject: lookup_task.c: Fix bug where only first four chars of name mattered --- schedsim/shell/shared/lookup_task.c | 12 +++++++++--- 1 file 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 ); -- cgit v1.2.3