summaryrefslogtreecommitdiffstats
path: root/doc/user
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-05-10 13:41:26 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-05-10 13:41:26 +0000
commit3bee7f4314c89ed1998b6cd1fe0a8f6bf0254fdf (patch)
tree8883d3c430b39978391adab4e6eeb08c4444d8c3 /doc/user
parent3ec0a3ce7ebbf27aaada06e22fa2b930a1b649a9 (diff)
downloadrtems-3bee7f4314c89ed1998b6cd1fe0a8f6bf0254fdf.tar.bz2
Made examples include checking of return status.
Diffstat (limited to 'doc/user')
-rw-r--r--doc/user/example.texi32
-rw-r--r--doc/user/rtmon.t20
2 files changed, 40 insertions, 12 deletions
diff --git a/doc/user/example.texi b/doc/user/example.texi
index 1b16e367b8..60862e6a6e 100644
--- a/doc/user/example.texi
+++ b/doc/user/example.texi
@@ -29,14 +29,30 @@ rtems_task init_task(
rtems_task_argument ignored
)
@{
- rtems_id tid;
-
- /* example assumes SUCCESSFUL return value */
-
- (void) rtems_task_create( USER_APP_NAME, 1, RTEMS_MINIMUM_STACK_SIZE,
- RTEMS_NO_PREEMPT, RTEMS_FLOATING_POINT, &tid );
- (void) rtems_task_start( tid, user_application, 0 );
- (void) rtems_task_delete( SELF );
+ rtems_id tid;
+ rtems_status_code status;
+ rtems_name name;
+
+ name = rtems_build_name( 'A', 'P', 'P', '1' )
+
+ status = rtems_task_create(
+ name, 1, RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_NO_PREEMPT, RTEMS_FLOATING_POINT, &tid
+ );
+ if ( status != RTEMS_STATUS_SUCCESSFUL ) {
+ printf( "rtems_task_create failed with status of %d.\n", status );
+ exit( 1 );
+ }
+
+ status = rtems_task_start( tid, user_application, 0 );
+ if ( status != RTEMS_STATUS_SUCCESSFUL ) {
+ printf( "rtems_task_start 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 );
@}
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