summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadgetschedparam.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-12-19 16:42:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-12-19 16:42:15 +0000
commit8f4bddd9c09e8ae3937d82a0133c30776b64c757 (patch)
treeac18dff0a0204072181ce7002a59ffd541660519 /cpukit/posix/src/pthreadgetschedparam.c
parent2000-12-14 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-8f4bddd9c09e8ae3937d82a0133c30776b64c757.tar.bz2
2000-12-19 Joel Sherrill <joel@OARcorp.com>
* src/pthreadgetschedparam.c: Do not set output parameters if the pointers are NULL.
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;
}