From 8932955e9a5d87cd41ef1965945a4ccc5c7aed38 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 4 Feb 2008 17:16:37 +0000 Subject: 2008-02-04 Joel Sherrill * rtems/src/rtemsobjectsetname.c, score/src/objectgetinfoid.c, score/src/objectgetnameasstring.c, score/src/objectidtoname.c: Handle Object Id of SELF. --- cpukit/score/src/objectgetnameasstring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpukit/score/src/objectgetnameasstring.c') diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c index ac70a5035d..0b8765d49b 100644 --- a/cpukit/score/src/objectgetnameasstring.c +++ b/cpukit/score/src/objectgetnameasstring.c @@ -41,6 +41,7 @@ char *_Objects_Get_name_as_string( char lname[5]; Objects_Control *the_object; Objects_Locations location; + Objects_Id tmpId; if ( length == 0 ) return NULL; @@ -48,11 +49,13 @@ char *_Objects_Get_name_as_string( if ( name == NULL ) return NULL; - information = _Objects_Get_information_id( id ); + tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; + + information = _Objects_Get_information_id( tmpId ); if ( !information ) return NULL; - the_object = _Objects_Get( information, id, &location ); + the_object = _Objects_Get( information, tmpId, &location ); switch ( location ) { #if defined(RTEMS_MULTIPROCESSING) -- cgit v1.2.3