From 2b454faf137960da9b7c783a159902ac1cc02469 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 26 Apr 2002 23:56:56 +0000 Subject: 2001-04-26 Joel Sherrill * include/rtems/score/object.h, inline/rtems/score/object.inl, src/objectcomparenamestring.c: Address PR81 that reworked POSIX message queues to add a descriptor separate from the underlying message queue. This allows non-blocking to follow the "open" not the underlying queue. As part of debugging this it became clear that _Objects_Compare_name_string was broken and a simple version using strncmp() was substituted. --- c/src/exec/score/src/objectcomparenamestring.c | 27 +++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'c/src/exec/score/src') diff --git a/c/src/exec/score/src/objectcomparenamestring.c b/c/src/exec/score/src/objectcomparenamestring.c index 9b1067bacb..045063e7cd 100644 --- a/c/src/exec/score/src/objectcomparenamestring.c +++ b/c/src/exec/score/src/objectcomparenamestring.c @@ -2,7 +2,7 @@ * Object Handler * * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2002. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -28,7 +28,15 @@ * * _Objects_Compare_name_string * - * XXX + * This routine compares the name of an object with the specified string. + * + * Input parameters: + * name_1 - one name + * name_2 - other name + * length - maximum length to compare + * + * Output parameters: + * returns - TRUE on a match */ boolean _Objects_Compare_name_string( @@ -37,16 +45,7 @@ boolean _Objects_Compare_name_string( unsigned32 length ) { - unsigned8 *name_1_p = (unsigned8 *) name_1; - unsigned8 *name_2_p = (unsigned8 *) name_2; - unsigned32 tmp_length = length; - - do { - if ( *name_1_p++ != *name_2_p++ ) - return FALSE; - if ( !tmp_length-- ) - return FALSE; - } while ( *name_1_p ); - - return TRUE; + if ( !strncmp( name_1_p, name_2_p, length ) ) + return TRUE; + return FALSE; } -- cgit v1.2.3