forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user