summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/semopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/semopen.c')
-rw-r--r--cpukit/posix/src/semopen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/posix/src/semopen.c b/cpukit/posix/src/semopen.c
index 3354935eba..398d9e8450 100644
--- a/cpukit/posix/src/semopen.c
+++ b/cpukit/posix/src/semopen.c
@@ -51,10 +51,10 @@ sem_t *sem_open(
mode_t mode;
unsigned int value = 0;
int status;
- sem_t the_semaphore_id;
- sem_t *id;
+ Objects_Id the_semaphore_id;
POSIX_Semaphore_Control *the_semaphore;
Objects_Locations location;
+ size_t name_len;
_Thread_Disable_dispatch();
@@ -65,7 +65,7 @@ sem_t *sem_open(
va_end(arg);
}
- status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
+ status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id, &name_len );
/*
* If the name to id translation worked, then the semaphore exists
@@ -96,7 +96,7 @@ sem_t *sem_open(
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
- the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
+ the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
_Thread_Enable_dispatch();
_Thread_Enable_dispatch();
@@ -110,6 +110,7 @@ sem_t *sem_open(
status =_POSIX_Semaphore_Create_support(
name,
+ name_len,
false, /* not shared across processes */
value,
&the_semaphore
@@ -127,9 +128,8 @@ sem_t *sem_open(
return_id:
#if defined(RTEMS_USE_16_BIT_OBJECT)
the_semaphore->Semaphore_id = the_semaphore->Object.id;
- id = &the_semaphore->Semaphore_id;
+ return &the_semaphore->Semaphore_id;
#else
- id = (sem_t *)&the_semaphore->Object.id;
+ return (sem_t *)&the_semaphore->Object.id;
#endif
- return id;
}