diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-26 19:24:15 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-26 19:24:15 +0000 |
commit | 87b88cefa2d7358754b61280dd94132f165759dd (patch) | |
tree | b76d3b9bdb96d3dbd3bc0b109562976cac155b25 /cpukit | |
parent | Let TCP/IP stack pick port rather than hard coding selection. Correction of ... (diff) | |
download | rtems-87b88cefa2d7358754b61280dd94132f165759dd.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')
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/score/src/coremsgbroadcast.c | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 12c5817223..f7873c4c68 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +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. + 2008-09-25 Eric Norum <norume@aps.anl.gov> * libnetworking/lib/rtems_bsdnet_ntp.c: Let TCP/IP stack pick port 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; |