diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 1999-11-22 16:08:53 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 1999-11-22 16:08:53 +0000 |
commit | f85409cf9c04f190fdde25f394c0e901757d56ff (patch) | |
tree | ba505a114c889d662fae6430843aba89d6122995 /cpukit/posix/src | |
parent | + Cleaned up comments. (diff) | |
download | rtems-f85409cf9c04f190fdde25f394c0e901757d56ff.tar.bz2 |
+ Added checks for NULL and NULL string names (for sem_open & sem_unlink).
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r-- | cpukit/posix/src/semaphorenametoid.c | 8 |
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; } |