diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-04-07 18:12:41 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-04-07 18:12:41 +0000 |
commit | b467831a38559a9cc8364b69f2078121463bc17f (patch) | |
tree | 00b916620f87e52782b0cc55c9245853c9fe71b8 /tools/schedsim/shell/shared/main_taskpriority.c | |
parent | 2011-04-07 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-b467831a38559a9cc8364b69f2078121463bc17f.tar.bz2 |
2011-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/main_clocktick.c, shared/main_semcreate.c,
shared/main_semdelete.c, shared/main_semflush.c,
shared/main_semobtain.c, shared/main_semrelease.c,
shared/main_taskcreate.c, shared/main_taskdelete.c,
shared/main_taskmode.c, shared/main_taskpriority.c,
shared/main_taskresume.c, shared/main_tasksuspend.c,
shared/main_taskwakeafter.c, shared/schedsim_shell.h: Compiles now
and do not core dump when RTEMS is not initialized.
Diffstat (limited to 'tools/schedsim/shell/shared/main_taskpriority.c')
-rw-r--r-- | tools/schedsim/shell/shared/main_taskpriority.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/schedsim/shell/shared/main_taskpriority.c b/tools/schedsim/shell/shared/main_taskpriority.c index fbe5073fa1..fd481242c0 100644 --- a/tools/schedsim/shell/shared/main_taskpriority.c +++ b/tools/schedsim/shell/shared/main_taskpriority.c @@ -34,6 +34,8 @@ int rtems_shell_main_task_priority( rtems_task_priority old; rtems_task_priority new; + CHECK_RTEMS_IS_UP(); + if (argc != 3) { fprintf( stderr, "%s: Usage [name|id] priority\n", argv[0] ); return -1; @@ -42,7 +44,7 @@ int rtems_shell_main_task_priority( if ( lookup_task( argv[1], &id ) ) return -1; - if ( rtems_string_to_unsigned_long( argv[1], &tmp, NULL, 0) ) { + if ( rtems_string_to_unsigned_long( argv[2], &tmp, NULL, 0) ) { fprintf( stderr, "Argument (%s) is not a number\n", argv[2] ); return 1; } @@ -63,7 +65,10 @@ int rtems_shell_main_task_priority( return -1; } - printf("Task (0x%08x) Chain Priority from %d to %d\n", id, old, new ); + if ( new != 0 ) + printf("Task (0x%08x) Change Priority from %d to %d\n", id, old, new ); + else + printf("Task (0x%08x) Current Priority is %d\n", id, new ); return 0; } |