diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-06-07 15:21:27 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-06-07 15:21:27 +0000 |
commit | 05ce4e097aeab6292b59a0d3b792cb403eeb6e03 (patch) | |
tree | 2f37ce9a4edec10f176cdee1f42c5edc5e8257ec /c/src/exec/posix/src/semaphore.c | |
parent | new file (diff) | |
download | rtems-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 'c/src/exec/posix/src/semaphore.c')
-rw-r--r-- | c/src/exec/posix/src/semaphore.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/c/src/exec/posix/src/semaphore.c b/c/src/exec/posix/src/semaphore.c index 628e094716..a968abe43b 100644 --- a/c/src/exec/posix/src/semaphore.c +++ b/c/src/exec/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 ) { |