summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/semaphorenametoid.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/semaphorenametoid.c')
-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;
}