diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-26 19:24:27 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-26 19:24:27 +0000 |
commit | 7cb469431117ec10590f84620c0c46e104f60d71 (patch) | |
tree | aa0503329e73dfed33489629e98384bd54ed7eb7 /cpukit/score/src/coremsgbroadcast.c | |
parent | 2008-09-26 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-7cb469431117ec10590f84620c0c46e104f60d71.tar.bz2 |
2008-09-26 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1316/cpukit
* score/src/coremsgbroadcast.c: Give error when message is too large
like when sending a message. This was the documented behavior.
Diffstat (limited to 'cpukit/score/src/coremsgbroadcast.c')
-rw-r--r-- | cpukit/score/src/coremsgbroadcast.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cpukit/score/src/coremsgbroadcast.c b/cpukit/score/src/coremsgbroadcast.c index 75bbae967b..91066054f3 100644 --- a/cpukit/score/src/coremsgbroadcast.c +++ b/cpukit/score/src/coremsgbroadcast.c @@ -7,7 +7,7 @@ * This core object provides task synchronization and communication functions * via messages passed to queue objects. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -63,7 +63,10 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast( Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; - size_t constrained_size; + + if ( size > the_message_queue->maximum_message_size ) { + return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; + } /* * If there are pending messages, then there can't be threads @@ -89,14 +92,10 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast( waitp = &the_thread->Wait; number_broadcasted += 1; - constrained_size = size; - if ( size > the_message_queue->maximum_message_size ) - constrained_size = the_message_queue->maximum_message_size; - _CORE_message_queue_Copy_buffer( buffer, waitp->return_argument_second.mutable_object, - constrained_size + size ); *(size_t *) the_thread->Wait.return_argument = size; |