summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-23 10:09:37 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-28 06:19:52 +0200
commit5bc7c3724fbb06d934401400ac5922bcae2c6e95 (patch)
tree7857429e00f8e495ed5ae3317c62e1a15458f374 /cpukit/posix/src
parentscore: Gather message queue control initialization (diff)
downloadrtems-5bc7c3724fbb06d934401400ac5922bcae2c6e95.tar.bz2
score: Improve _CORE_message_queue_Initialize()
Return a status code and differentiate between error conditions. Update #4007.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r--cpukit/posix/src/mqueueopen.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c
index 35b8c923b1..af8abebea8 100644
--- a/cpukit/posix/src/mqueueopen.c
+++ b/cpukit/posix/src/mqueueopen.c
@@ -60,6 +60,7 @@ static mqd_t _POSIX_Message_queue_Create(
{
POSIX_Message_queue_Control *the_mq;
char *name;
+ Status_Control status;
/* length of name has already been validated */
@@ -97,14 +98,14 @@ static mqd_t _POSIX_Message_queue_Create(
* Joel: Cite POSIX or OpenGroup on above statement so we can determine
* if it is a real requirement.
*/
- if (
- !_CORE_message_queue_Initialize(
- &the_mq->Message_queue,
- CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
- attr->mq_maxmsg,
- attr->mq_msgsize
- )
- ) {
+ status = _CORE_message_queue_Initialize(
+ &the_mq->Message_queue,
+ CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
+ attr->mq_maxmsg,
+ attr->mq_msgsize
+ );
+
+ if ( status != STATUS_SUCCESSFUL ) {
_POSIX_Message_queue_Free( the_mq );
_Workspace_Free( name );
rtems_set_errno_and_return_value( ENOSPC, MQ_OPEN_FAILED );