summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/exec/posix/src/semaphorenametoid.c8
-rw-r--r--cpukit/posix/src/semaphorenametoid.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/c/src/exec/posix/src/semaphorenametoid.c b/c/src/exec/posix/src/semaphorenametoid.c
index c6de93c201..47879402cc 100644
--- a/c/src/exec/posix/src/semaphorenametoid.c
+++ b/c/src/exec/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;
}
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;
}