summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>1999-11-22 16:08:53 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>1999-11-22 16:08:53 +0000
commitf85409cf9c04f190fdde25f394c0e901757d56ff (patch)
treeba505a114c889d662fae6430843aba89d6122995 /cpukit
parent+ Cleaned up comments. (diff)
downloadrtems-f85409cf9c04f190fdde25f394c0e901757d56ff.tar.bz2
+ Added checks for NULL and NULL string names (for sem_open & sem_unlink).
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/src/semaphorenametoid.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpukit/posix/src/semaphorenametoid.c b/cpukit/posix/src/semaphorenametoid.c
index c6de93c201..47879402cc 100644
--- a/cpukit/posix/src/semaphorenametoid.c
+++ b/cpukit/posix/src/semaphorenametoid.c
@@ -31,12 +31,18 @@ int _POSIX_Semaphore_Name_to_id(
{
Objects_Name_to_id_errors status;
+ if ( !name )
+ return EINVAL;
+
+ if ( !name[0] )
+ return EINVAL;
+
status = _Objects_Name_to_id(
&_POSIX_Semaphore_Information, (char *)name, 0, id );
if ( status == OBJECTS_SUCCESSFUL )
return 0;
- return EINVAL;
+ return ENOENT;
}