summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2015-04-14 12:11:51 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-04-14 12:12:50 -0500
commit1047f37cac02909b33d16462f14dc5f45e98d376 (patch)
treef784a6bfadd05aec2cb6a2d916ac6c641da51055 /cpukit
parentsemunlink.c: Add missing _Objects_Allocator_unlock() (diff)
downloadrtems-1047f37cac02909b33d16462f14dc5f45e98d376.tar.bz2
semdestroy.c: Add missing _Objects_Allocator_unlock()
closes 2319.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/src/semdestroy.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/cpukit/posix/src/semdestroy.c b/cpukit/posix/src/semdestroy.c
index 1c695bb837..9a8a993c81 100644
--- a/cpukit/posix/src/semdestroy.c
+++ b/cpukit/posix/src/semdestroy.c
@@ -44,19 +44,18 @@ int sem_destroy(
case OBJECTS_LOCAL:
/*
- * Undefined operation on a named semaphore.
+ * Undefined operation on a named semaphore. Release the object
+ * and fall to the EINVAL return at the bottom.
*/
-
if ( the_semaphore->named == true ) {
_Objects_Put( &the_semaphore->Object );
- rtems_set_errno_and_return_minus_one( EINVAL );
+ } else {
+ _POSIX_Semaphore_Delete( the_semaphore );
+ _Objects_Put( &the_semaphore->Object );
+ _Objects_Allocator_unlock();
+ return 0;
}
- _POSIX_Semaphore_Delete( the_semaphore );
- _Objects_Put( &the_semaphore->Object );
- _Objects_Allocator_unlock();
- return 0;
-
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE:
#endif