summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/semaphore.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-06-07 15:21:27 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-06-07 15:21:27 +0000
commit05ce4e097aeab6292b59a0d3b792cb403eeb6e03 (patch)
tree2f37ce9a4edec10f176cdee1f42c5edc5e8257ec /cpukit/posix/src/semaphore.c
parentnew file (diff)
downloadrtems-05ce4e097aeab6292b59a0d3b792cb403eeb6e03.tar.bz2
changed code which set errno and then returned -1 to use the macro
set_errno_and_return_minus_one.
Diffstat (limited to 'cpukit/posix/src/semaphore.c')
-rw-r--r--cpukit/posix/src/semaphore.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/cpukit/posix/src/semaphore.c b/cpukit/posix/src/semaphore.c
index 628e094716..a968abe43b 100644
--- a/cpukit/posix/src/semaphore.c
+++ b/cpukit/posix/src/semaphore.c
@@ -64,8 +64,7 @@ int _POSIX_Semaphore_Create_support(
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
- seterrno( ENOMEM );
- return -1;
+ set_errno_and_return_minus_one( ENOMEM );
}
if ( pshared == PTHREAD_PROCESS_SHARED &&
@@ -73,8 +72,7 @@ int _POSIX_Semaphore_Create_support(
the_semaphore->Object.id, FALSE ) ) ) {
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
- seterrno( EAGAIN );
- return -1;
+ set_errno_and_return_minus_one( EAGAIN );
}
the_semaphore->process_shared = pshared;
@@ -382,10 +380,8 @@ int sem_unlink(
status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
- if ( !status ) {
- seterrno( status );
- return -1;
- }
+ if ( !status )
+ set_errno_and_return_minus_one( status );
the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
switch ( location ) {