summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadgetschedparam.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/pthreadgetschedparam.c')
-rw-r--r--cpukit/posix/src/pthreadgetschedparam.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c
index 258734bc5d..055fd45ac8 100644
--- a/cpukit/posix/src/pthreadgetschedparam.c
+++ b/cpukit/posix/src/pthreadgetschedparam.c
@@ -40,10 +40,13 @@ int pthread_getschedparam(
return ESRCH;
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- *policy = api->schedpolicy;
- *param = api->schedparam;
- param->sched_priority =
- _POSIX_Priority_From_core( the_thread->current_priority );
+ if ( policy )
+ *policy = api->schedpolicy;
+ if ( param ) {
+ *param = api->schedparam;
+ param->sched_priority =
+ _POSIX_Priority_From_core( the_thread->current_priority );
+ }
_Thread_Enable_dispatch();
return 0;
}