From e93d791135afe7bfcd75240fc938c04be3335a83 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 2 Mar 2009 16:12:41 +0000 Subject: 2009-03-02 Joel Sherrill 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. --- cpukit/ChangeLog | 7 +++++++ cpukit/rtems/src/semcreate.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 441b26cc1e..843e3a4c0c 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,10 @@ +2009-03-02 Joel Sherrill + + 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-02-27 Sebastian Huber * libmisc/shell/shell.c, libmisc/shell/shell.h: Changed type for diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c index efacd6df5e..d5274daeea 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; -- cgit v1.2.3