From 05ce4e097aeab6292b59a0d3b792cb403eeb6e03 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 7 Jun 1996 15:21:27 +0000 Subject: changed code which set errno and then returned -1 to use the macro set_errno_and_return_minus_one. --- cpukit/posix/src/mqueue.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'cpukit/posix/src/mqueue.c') diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c index b489643401..82da4ee706 100644 --- a/cpukit/posix/src/mqueue.c +++ b/cpukit/posix/src/mqueue.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -76,8 +77,7 @@ int _POSIX_Message_queue_Create_support( if ( !the_mq ) { _Thread_Enable_dispatch(); - seterrno( ENFILE ); - return -1; + set_errno_and_return_minus_one( ENFILE ); } if ( pshared == PTHREAD_PROCESS_SHARED && @@ -85,8 +85,7 @@ int _POSIX_Message_queue_Create_support( the_mq->Object.id, FALSE ) ) ) { _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); - seterrno( ENFILE ); - return -1; + set_errno_and_return_minus_one( ENFILE ); } the_mq->process_shared = pshared; @@ -134,8 +133,7 @@ int _POSIX_Message_queue_Create_support( _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); - seterrno( ENOSPC ); - return -1; + set_errno_and_return_minus_one( ENOSPC ); } @@ -323,10 +321,8 @@ int mq_unlink( status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); - if ( !status ) { - seterrno( status ); - return -1; - } + if ( !status ) + set_errno_and_return_minus_one( status ); the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); switch ( location ) { -- cgit v1.2.3