From adc2301723ad8b8ddb17d51c7d38950865db8b44 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 30 Nov 2013 16:06:07 -0600 Subject: psxtmthread02/init.c: Fix warnings --- testsuites/psxtmtests/psxtmthread02/init.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'testsuites/psxtmtests') diff --git a/testsuites/psxtmtests/psxtmthread02/init.c b/testsuites/psxtmtests/psxtmthread02/init.c index bfa3ab8c9a..6d5333a098 100644 --- a/testsuites/psxtmtests/psxtmthread02/init.c +++ b/testsuites/psxtmtests/psxtmthread02/init.c @@ -13,6 +13,7 @@ #include #include +#include #include #include "test_support.h" @@ -28,11 +29,18 @@ void benchmark_pthread_create(void) pthread_attr_t attr; struct sched_param param; - pthread_attr_init(&attr); - pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); - pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + status = pthread_attr_init(&attr); + rtems_test_assert( status == 0 ); + + status = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + rtems_test_assert( status == 0 ); + + status = pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + rtems_test_assert( status == 0 ); + param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1; - pthread_attr_setschedparam(&attr, ¶m); + status = pthread_attr_setschedparam(&attr, ¶m); + rtems_test_assert( status == 0 ); /* create second thread with max priority and get preempted on creation */ benchmark_timer_initialize(); -- cgit v1.2.3