diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-03-02 16:13:35 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-03-02 16:13:35 +0000 |
commit | 86458b0e9792d33c545aa699318c0780b21fd981 (patch) | |
tree | eceb41261a8d923126fd135c4f7e9ddb5617b6b8 | |
parent | cc88fb7e8401a0a2d276064d349b29bd0b01c761 (diff) |
2009-03-02 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1388/cpukit
* rtems/src/semcreate.c: Classic Semaphores allow both priority inherit
and ceiling attributes to be set on semaphore create. These
attributes are mutually exclusive and this should be an error.
-rw-r--r-- | cpukit/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/rtems/src/semcreate.c | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 7f06a72f6f..03466bd645 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,10 @@ +2009-03-02 Joel Sherrill <joel.sherrill@OARcorp.com> + + PR 1388/cpukit + * rtems/src/semcreate.c: Classic Semaphores allow both priority inherit + and ceiling attributes to be set on semaphore create. These + attributes are mutually exclusive and this should be an error. + 2009-01-29 Nickolay Semyonov-Kolchin <nbkolchin@gmail.com> PR 1359/cpukit diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c index ec34436b87..d7827c116c 100644 --- a/cpukit/rtems/src/semcreate.c +++ b/cpukit/rtems/src/semcreate.c @@ -15,7 +15,7 @@ * + acquire a semaphore * + release a semaphore * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -111,6 +111,10 @@ rtems_status_code rtems_semaphore_create( } + if ( _Attributes_Is_inherit_priority( attribute_set ) && + _Attributes_Is_priority_ceiling( attribute_set ) ) + return RTEMS_NOT_DEFINED; + if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) return RTEMS_INVALID_NUMBER; |