diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-09-23 10:09:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-09-28 06:19:52 +0200 |
commit | 5bc7c3724fbb06d934401400ac5922bcae2c6e95 (patch) | |
tree | 7857429e00f8e495ed5ae3317c62e1a15458f374 /cpukit/posix | |
parent | score: Gather message queue control initialization (diff) | |
download | rtems-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')
-rw-r--r-- | cpukit/posix/src/mqueueopen.c | 17 |
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 ); |