[yocto] [meta-cgl][PATCH 3/5] openais: fix saTmrTimerReschedule test error
jackie.huang at windriver.com
jackie.huang at windriver.com
Fri May 26 01:46:13 PDT 2017
From: Jackie Huang <jackie.huang at windriver.com>
* If req_lib_tmr_timerreschedule->timer_attributes.type is
SA_TIME_ABSOLUTE, an absolute time value must be higher
than the current absolute time.According to the type, we
will compare the current time with an absolute time. If
the type is SA_TIME_ABSOLUTE, we will compare. Or else,
we do nothing;
* For single-event timers, timerPeriodDuration = 0 is required.
Note that saTmrTimerReschedule() cannot be used to change a
timer from being a single-event timer to a periodic timer or
vice versa. Since the older timerPeriodDuration is 0 in testtmr.c
file, it is a single-event timer. The following reschedule will
change it to a periodic timer. It is not permitted.
Signed-off-by: yanjun.zhu <yanjun.zhu at windriver.com>
Signed-off-by: Jackie Huang <jackie.huang at windriver.com>
---
.../openais-saTmrTimerReschedule-test-error.patch | 50 ++++++++++++++++++++++
.../recipes-cgl/openais/openais_1.1.4.bb | 1 +
2 files changed, 51 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch
diff --git a/meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch b/meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch
new file mode 100644
index 0000000..6806fba
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch
@@ -0,0 +1,50 @@
+commit 379eb121110d22131408cedf2f200165d142852c
+Author: yanjun.zhu <yanjun.zhu at windriver.com>
+Date: Fri Mar 1 12:25:33 2013 +0800
+
+ openais: fix saTmrTimerReschedule test error
+
+ * If req_lib_tmr_timerreschedule->timer_attributes.type is
+ SA_TIME_ABSOLUTE, an absolute time value must be higher
+ than the current absolute time.According to the type, we
+ will compare the current time with an absolute time. If
+ the type is SA_TIME_ABSOLUTE, we will compare. Or else,
+ we do nothing;
+ * For single-event timers, timerPeriodDuration = 0 is required.
+ Note that saTmrTimerReschedule() cannot be used to change a
+ timer from being a single-event timer to a periodic timer or
+ vice versa. Since the older timerPeriodDuration is 0 in testtmr.c
+ file, it is a single-event timer. The following reschedule will
+ change it to a periodic timer. It is not permitted.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: yanjun.zhu <yanjun.zhu at windriver.com>
+--
+diff -urpN a/services/tmr.c b/services/tmr.c
+--- a/services/tmr.c
++++ b/services/tmr.c
+@@ -442,7 +442,8 @@ static void message_handler_req_lib_tmr_
+
+ current_time = (SaTimeT)(api->timer_time_get());
+
+- if (current_time > req_lib_tmr_timerreschedule->timer_attributes.initialExpirationTime) {
++ if ((SA_TIME_ABSOLUTE == req_lib_tmr_timerreschedule->timer_attributes.type) &&
++ (current_time > req_lib_tmr_timerreschedule->timer_attributes.initialExpirationTime)) {
+ error = SA_AIS_ERR_INVALID_PARAM;
+ goto error_put;
+ }
+diff -urpN a/test/testtmr.c b/test/testtmr.c
+--- a/test/testtmr.c
++++ b/test/testtmr.c
+@@ -86,8 +86,8 @@ int main (void)
+ SaTmrHandleT handle;
+ SaSelectionObjectT select_obj;
+ SaTmrTimerAttributesT attrs;
+- SaTmrTimerAttributesT attrs_a = { SA_TIME_DURATION, TMR_30_SECONDS, 0 };
+- SaTmrTimerAttributesT attrs_b = { SA_TIME_DURATION, TMR_30_SECONDS, 0 };
++ SaTmrTimerAttributesT attrs_a = { SA_TIME_DURATION, TMR_30_SECONDS, TMR_30_SECONDS };
++ SaTmrTimerAttributesT attrs_b = { SA_TIME_DURATION, TMR_30_SECONDS, TMR_30_SECONDS };
+ SaTmrTimerAttributesT new_attrs_a = { SA_TIME_DURATION, TMR_10_SECONDS, TMR_10_SECONDS };
+ SaTmrTimerAttributesT new_attrs_b = { SA_TIME_DURATION, TMR_20_SECONDS, TMR_20_SECONDS };
+ SaTmrTimerIdT id_a;
diff --git a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
index 0693ddb..d54b22f 100644
--- a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
+++ b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
@@ -10,6 +10,7 @@ SRC_URI = " \
file://build-cleanup-configure-ac.patch \
file://openais-fix-bash.patch \
file://openais-fix-init-script.patch \
+ file://openais-saTmrTimerReschedule-test-error.patch \
file://openais.service \
"
--
2.11.0
More information about the yocto
mailing list