nuttx-apps/testing/ltp/0003-LTP-Re-init-static-variable-to-avoid-errors-during-m.patch

47 lines
1.7 KiB
Diff
Raw Normal View History

From f7b61dd11c404f5268fcf651744388c10f47d974 Mon Sep 17 00:00:00 2001
From: Huang Qi <huangqi3@xiaomi.com>
Date: Thu, 28 Jan 2021 13:29:25 +0800
Subject: [PATCH 06/21] LTP: Re-init static variable to avoid errors during
multiple runs
MIRTOS-361
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I81fb72b33a3381dfe18c0193e56bcd3d67a3a5eb
---
.../conformance/interfaces/pthread_cond_signal/2-1.c | 3 +++
.../conformance/interfaces/pthread_cond_signal/4-1.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c
index ff62336c9..c00cb4731 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c
@@ -101,6 +101,9 @@ int main(void)
struct sigaction act;
pthread_mutexattr_t ma;
+ waken_num = 0;
+ start_num = 0;
+
if (pthread_mutexattr_init(&ma) != 0) {
fprintf(stderr, "Fail to initialize mutex attribute\n");
return PTS_UNRESOLVED;
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c
index 36dc91ec9..bbb7acfcf 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c
@@ -79,6 +79,9 @@ int main(void)
int i, rc;
struct sigaction act;
+ waken_num = 0;
+ start_num = 0;
+
if (pthread_mutex_init(&td.mutex, NULL) != 0) {
fprintf(stderr, "Fail to initialize mutex\n");
return PTS_UNRESOLVED;
--
2.40.1