diff options
Diffstat (limited to 'cpukit/rtems/src/timerserver.c')
-rw-r--r-- | cpukit/rtems/src/timerserver.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c index af6910bd5a..01bb597f1c 100644 --- a/cpukit/rtems/src/timerserver.c +++ b/cpukit/rtems/src/timerserver.c @@ -149,14 +149,17 @@ rtems_status_code rtems_timer_initiate_server( rtems_task_priority _priority; /* - * Make sure the requested priority is valid. + * Make sure the requested priority is valid. The if is + * structured so we check it is invalid before looking for + * a specific invalid value as the default. */ _priority = priority; - if ( priority == RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) + if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { + if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) + return RTEMS_INVALID_PRIORITY; _priority = 0; - else if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) - return RTEMS_INVALID_PRIORITY; + } /* * Just to make sure the test versus create/start operation are atomic. |