diff options
Diffstat (limited to 'lib/libthr/thread/thr_mutex_protocol.c')
-rw-r--r-- | lib/libthr/thread/thr_mutex_protocol.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/libthr/thread/thr_mutex_protocol.c b/lib/libthr/thread/thr_mutex_protocol.c index f7be5a6..56c8622 100644 --- a/lib/libthr/thread/thr_mutex_protocol.c +++ b/lib/libthr/thread/thr_mutex_protocol.c @@ -43,28 +43,19 @@ __weak_reference(_pthread_mutexattr_setprotocol, pthread_mutexattr_setprotocol); int _pthread_mutexattr_getprotocol(pthread_mutexattr_t *mattr, int *protocol) { - int ret = 0; - - if ((mattr == NULL) || (*mattr == NULL)) - ret = EINVAL; - else - *protocol = (*mattr)->m_protocol; - - return(ret); + if (*mattr == NULL) + return (EINVAL); + *protocol = (*mattr)->m_protocol; + return(0); } int _pthread_mutexattr_setprotocol(pthread_mutexattr_t *mattr, int protocol) { - int ret = 0; - - if ((mattr == NULL) || (*mattr == NULL) || - (protocol < PTHREAD_PRIO_NONE) || (protocol > PTHREAD_PRIO_PROTECT)) - ret = EINVAL; - else { - (*mattr)->m_protocol = protocol; - (*mattr)->m_ceiling = PTHREAD_MAX_PRIORITY; - } - return(ret); + if (*mattr == NULL || protocol < PTHREAD_PRIO_NONE || + protocol > PTHREAD_PRIO_PROTECT) + return (EINVAL); + (*mattr)->m_protocol = protocol; + (*mattr)->m_ceiling = PTHREAD_MAX_PRIORITY; + return(0); } - |