[rtems commit] rtems: rtems_scheduler_get_processor_set() status
Sebastian Huber
sebh at rtems.org
Thu May 6 13:14:56 UTC 2021
Module: rtems
Branch: master
Commit: 48898b3a5d27a73a65f2b7520ceb53005d45c984
Changeset: http://git.rtems.org/rtems/commit/?id=48898b3a5d27a73a65f2b7520ceb53005d45c984
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed May 5 14:26:01 2021 +0200
rtems: rtems_scheduler_get_processor_set() status
In case the processor set is not large enough to contain the processor
set owned by the scheduler return RTEMS_INVALID_SIZE instead of
RTEMS_INVALID_NUMBER. This is more in line with other directives since
the issue is related to the size of an object.
Close #4401.
---
cpukit/rtems/src/schedulergetprocessorset.c | 2 +-
testsuites/sptests/spscheduler01/init.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpukit/rtems/src/schedulergetprocessorset.c b/cpukit/rtems/src/schedulergetprocessorset.c
index 6027ab3..71a3515 100644
--- a/cpukit/rtems/src/schedulergetprocessorset.c
+++ b/cpukit/rtems/src/schedulergetprocessorset.c
@@ -50,7 +50,7 @@ rtems_status_code rtems_scheduler_get_processor_set(
processor_set = _Scheduler_Get_processors( scheduler );
status = _Processor_mask_To_cpu_set_t( processor_set, cpusetsize, cpuset );
if ( status != PROCESSOR_MASK_COPY_LOSSLESS ) {
- return RTEMS_INVALID_NUMBER;
+ return RTEMS_INVALID_SIZE;
}
return RTEMS_SUCCESSFUL;
diff --git a/testsuites/sptests/spscheduler01/init.c b/testsuites/sptests/spscheduler01/init.c
index 94ecfe4..7b24dae 100644
--- a/testsuites/sptests/spscheduler01/init.c
+++ b/testsuites/sptests/spscheduler01/init.c
@@ -602,7 +602,7 @@ static void test_scheduler_get_processors(void)
rtems_test_assert(sc == RTEMS_INVALID_ID);
sc = rtems_scheduler_get_processor_set(scheduler_id, 0, &cpuset);
- rtems_test_assert(sc == RTEMS_INVALID_NUMBER);
+ rtems_test_assert(sc == RTEMS_INVALID_SIZE);
sc = rtems_scheduler_get_processor_set(scheduler_id, sizeof(cpuset), &cpuset);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
More information about the vc
mailing list