From 8f4bddd9c09e8ae3937d82a0133c30776b64c757 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 19 Dec 2000 16:42:15 +0000 Subject: 2000-12-19 Joel Sherrill * src/pthreadgetschedparam.c: Do not set output parameters if the pointers are NULL. --- c/src/exec/posix/ChangeLog | 5 +++++ c/src/exec/posix/src/pthreadgetschedparam.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'c') diff --git a/c/src/exec/posix/ChangeLog b/c/src/exec/posix/ChangeLog index 6ea0ce871d..1103b9b2a8 100644 --- a/c/src/exec/posix/ChangeLog +++ b/c/src/exec/posix/ChangeLog @@ -1,3 +1,8 @@ +2000-12-19 Joel Sherrill + + * src/pthreadgetschedparam.c: Do not set output parameters if + the pointers are NULL. + 2000-12-06 Joel Sherrill * src/pthreadgetcpuclockid.c: Add include of to diff --git a/c/src/exec/posix/src/pthreadgetschedparam.c b/c/src/exec/posix/src/pthreadgetschedparam.c index 258734bc5d..055fd45ac8 100644 --- a/c/src/exec/posix/src/pthreadgetschedparam.c +++ b/c/src/exec/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; } -- cgit v1.2.3