forked from Imagelibrary/rtems
Added EINVAL for passing a NULL pointer in.
This commit is contained in:
@@ -30,6 +30,10 @@ int sem_init(
|
|||||||
int status;
|
int status;
|
||||||
POSIX_Semaphore_Control *the_semaphore;
|
POSIX_Semaphore_Control *the_semaphore;
|
||||||
|
|
||||||
|
if ( !*sem )
|
||||||
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
|
|
||||||
|
|
||||||
status = _POSIX_Semaphore_Create_support(
|
status = _POSIX_Semaphore_Create_support(
|
||||||
NULL,
|
NULL,
|
||||||
pshared,
|
pshared,
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ int sem_init(
|
|||||||
int status;
|
int status;
|
||||||
POSIX_Semaphore_Control *the_semaphore;
|
POSIX_Semaphore_Control *the_semaphore;
|
||||||
|
|
||||||
|
if ( !*sem )
|
||||||
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
|
|
||||||
|
|
||||||
status = _POSIX_Semaphore_Create_support(
|
status = _POSIX_Semaphore_Create_support(
|
||||||
NULL,
|
NULL,
|
||||||
pshared,
|
pshared,
|
||||||
|
|||||||
Reference in New Issue
Block a user