From 87b88cefa2d7358754b61280dd94132f165759dd Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 26 Sep 2008 19:24:15 +0000 Subject: 2008-09-26 Joel Sherrill PR 1316/cpukit * score/src/coremsgbroadcast.c: Give error when message is too large like when sending a message. This was the documented behavior. --- cpukit/ChangeLog | 6 ++++++ cpukit/score/src/coremsgbroadcast.c | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'cpukit') 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 + + 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 * 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; -- cgit v1.2.3