diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-01 14:16:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-02 14:05:02 +0200 |
commit | 3b3d1489e409d451b4e7ffabd706d0205f400def (patch) | |
tree | 6c7e25427190f5f8de8bdae99e964cc4023c21ae /cpukit/posix/src/setcancelstate.c | |
parent | psxtests/psxcancel: Check return status (diff) | |
download | rtems-3b3d1489e409d451b4e7ffabd706d0205f400def.tar.bz2 |
posix: glibc compatibility
Diffstat (limited to 'cpukit/posix/src/setcancelstate.c')
-rw-r--r-- | cpukit/posix/src/setcancelstate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/posix/src/setcancelstate.c b/cpukit/posix/src/setcancelstate.c index 0ae7339e46..a451c2c4b4 100644 --- a/cpukit/posix/src/setcancelstate.c +++ b/cpukit/posix/src/setcancelstate.c @@ -50,9 +50,6 @@ int pthread_setcancelstate( if ( _ISR_Is_in_progress() ) return EPROTO; - if ( !oldstate ) - return EINVAL; - if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) return EINVAL; @@ -61,7 +58,9 @@ int pthread_setcancelstate( executing = _Thread_Executing; thread_support = executing ->API_Extensions[ THREAD_API_POSIX ]; - *oldstate = thread_support->cancelability_state; + if (oldstate != NULL) + *oldstate = thread_support->cancelability_state; + thread_support->cancelability_state = state; _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( executing ); |