From 3bee7f4314c89ed1998b6cd1fe0a8f6bf0254fdf Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 10 May 2000 13:41:26 +0000 Subject: Made examples include checking of return status. --- doc/user/rtmon.t | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'doc/user/rtmon.t') diff --git a/doc/user/rtmon.t b/doc/user/rtmon.t index bcfd8a6053..73b28cb97c 100644 --- a/doc/user/rtmon.t +++ b/doc/user/rtmon.t @@ -723,10 +723,15 @@ rtems_task Periodic_task() name = rtems_build_name( 'P', 'E', 'R', 'D' ); - (void) rate_monotonic_create( name, &period ); + status = rate_monotonic_create( name, &period ); + if ( status != RTEMS_STATUS_SUCCESSFUL ) { + printf( "rtems_monotonic_create failed with status of %d.\n", rc ); + exit( 1 ); + } + while ( 1 ) @{ - if ( rate_monotonic_period( period, 100 ) == TIMEOUT ) + if ( rate_monotonic_period( period, 100 ) == RTEMS_TIMEOUT ) break; /* Perform some periodic actions */ @@ -734,8 +739,15 @@ rtems_task Periodic_task() /* missed period so delete period and SELF */ - (void) rate_monotonic_delete( period ); - (void) task_delete( SELF ); + status = rate_monotonic_delete( period ); + if ( status != RTEMS_STATUS_SUCCESSFUL ) { + printf( "rate_monotonic_delete failed with status of %d.\n", status ); + exit( 1 ); + } + + status = rtems_task_delete( SELF ); /* should not return */ + printf( "rtems_task_delete returned with status of %d.\n", status ); + exit( 1 ); @} @end example -- cgit v1.2.3