summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-04-26 23:56:56 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-04-26 23:56:56 +0000
commit2b454faf137960da9b7c783a159902ac1cc02469 (patch)
tree7bb8f91f392b2eee1e292cbc70a117bdb5492be6 /c/src/exec/score/src
parent2001-04-26 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-2b454faf137960da9b7c783a159902ac1cc02469.tar.bz2
2001-04-26 Joel Sherrill <joel@OARcorp.com>
* 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.
Diffstat (limited to 'c/src/exec/score/src')
-rw-r--r--c/src/exec/score/src/objectcomparenamestring.c27
1 files changed, 13 insertions, 14 deletions
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;
}