diff options
Diffstat (limited to 'c/src/exec/posix/src/mqueuesendsupp.c')
-rw-r--r-- | c/src/exec/posix/src/mqueuesendsupp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/c/src/exec/posix/src/mqueuesendsupp.c b/c/src/exec/posix/src/mqueuesendsupp.c index 9615244583..5a1f2cd708 100644 --- a/c/src/exec/posix/src/mqueuesendsupp.c +++ b/c/src/exec/posix/src/mqueuesendsupp.c @@ -87,8 +87,19 @@ int _POSIX_Message_queue_Send_support( ); _Thread_Enable_dispatch(); + + /* + * If we had to block, then this is where the task returns + * after it wakes up. The returned status is correct for + * non-blocking operations but if we blocked, then we need + * to look at the status in our TCB. + */ + + if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) + msg_status = _Thread_Executing->Wait.return_code; + if ( !msg_status ) - return 0; + return msg_status; set_errno_and_return_minus_one( _POSIX_Message_queue_Translate_core_message_queue_return_code( |