[rtems commit] psxtmthread02/init.c: Fix warnings
Joel Sherrill
joel at rtems.org
Sat Nov 30 22:00:59 UTC 2013
Module: rtems
Branch: master
Commit: adc2301723ad8b8ddb17d51c7d38950865db8b44
Changeset: http://git.rtems.org/rtems/commit/?id=adc2301723ad8b8ddb17d51c7d38950865db8b44
Author: Joel Sherrill <joel.sherrill at oarcorp.com>
Date: Sat Nov 30 16:06:07 2013 -0600
psxtmthread02/init.c: Fix warnings
---
testsuites/psxtmtests/psxtmthread02/init.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/testsuites/psxtmtests/psxtmthread02/init.c b/testsuites/psxtmtests/psxtmthread02/init.c
index bfa3ab8..6d5333a 100644
--- a/testsuites/psxtmtests/psxtmthread02/init.c
+++ b/testsuites/psxtmtests/psxtmthread02/init.c
@@ -13,6 +13,7 @@
#include <timesys.h>
#include <pthread.h>
+#include <sched.h>
#include <rtems/timerdrv.h>
#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();
More information about the vc
mailing list