diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-12-13 12:56:53 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-12-13 12:56:53 +0000 |
commit | b98d399f3c4f7fc19a80a7f12503f0b4226c59dc (patch) | |
tree | 82a06feb8b1ac21527aee2be7c7c3cd37a7e70b9 /cpukit/posix/src/semopen.c | |
parent | 2011-12-13 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-b98d399f3c4f7fc19a80a7f12503f0b4226c59dc.tar.bz2 |
2011-12-13 Sebastian Huber <sebastian.huber@embedded-brains.de>
* posix/src/mqueuenametoid.c,
posix/src/semaphorenametoid.c: Removed files.
* posix/src/psxnametoid.c: New file.
* posix/Makefile.am: Reflect changes above.
* posix/include/rtems/posix/config.h: Fixed integer types.
* posix/include/rtems/posix/posixapi.h: Declare _POSIX_Name_to_id().
* posix/include/rtems/posix/mqueue.h,
posix/inline/rtems/posix/mqueue.inl: Changed parameter of
_POSIX_Message_queue_Create_support().
_POSIX_Message_queue_Name_to_id() is now inline.
* posix/include/rtems/posix/semaphore.h,
posix/inline/rtems/posix/semaphore.inl: Changed parameter of
_POSIX_Semaphore_Create_support(). _POSIX_Semaphore_Name_to_id() is
now inline.
* posix/src/mqueuecreatesupp.c, posix/src/semaphorecreatesupp.c: Use
_Workspace_String_duplicate().
* posix/src/mqueuesendsupp.c, posix/src/mqueueopen.c,
posix/src/mqueueunlink.c, posix/src/seminit.c, posix/src/semopen.c,
posix/src/semunlink.c: Update due to API changes.
Diffstat (limited to 'cpukit/posix/src/semopen.c')
-rw-r--r-- | cpukit/posix/src/semopen.c | 14 |
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; } |