[LTP] [PATCH] testcases/kernel/fs: declare int openlog as static
Fabrice Fontaine
fontaine.fabrice@gmail.com
Sun Apr 24 21:56:36 CEST 2022
Declare int openlog as static to avoid the following build failure when
building statically (e.g. on buildroot):
/nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/10.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: /nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(syslog.os): in function `openlog':
syslog.c:(.text+0x6b8): multiple definition of `openlog'; /tmp/ccvRnqfT.o:/nvmedata/autobuild/instance-15/output-1/build/ltp-testsuite-20220121/testcases/kernel/fs/fs-bench/random-access.c:14: first defined here
Fixes:
- http://autobuild.buildroot.org/results/bfd0d906a05564a4f323db604f3b908abf552b20
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
testcases/kernel/fs/fs-bench/random-access-del-create.c | 2 +-
testcases/kernel/fs/fs-bench/random-access.c | 2 +-
testcases/kernel/fs/fs-bench/random-del-create.c | 2 +-
testcases/kernel/fs/scsi/ltpfs/main.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/fs/fs-bench/random-access-del-create.c b/testcases/kernel/fs/fs-bench/random-access-del-create.c
index 1f62a76b5..8e21c7f74 100644
--- a/testcases/kernel/fs/fs-bench/random-access-del-create.c
+++ b/testcases/kernel/fs/fs-bench/random-access-del-create.c
@@ -11,7 +11,7 @@
#define FAIL 0
#define SUCCESS 1
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
#define MAXNUM 0x100000
diff --git a/testcases/kernel/fs/fs-bench/random-access.c b/testcases/kernel/fs/fs-bench/random-access.c
index cf41d6e81..c2f32b86e 100644
--- a/testcases/kernel/fs/fs-bench/random-access.c
+++ b/testcases/kernel/fs/fs-bench/random-access.c
@@ -11,7 +11,7 @@
#define FAIL 0
#define SUCCESS 1
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
#define MAXNUM 0x100000
diff --git a/testcases/kernel/fs/fs-bench/random-del-create.c b/testcases/kernel/fs/fs-bench/random-del-create.c
index 0a86f976f..345031f28 100644
--- a/testcases/kernel/fs/fs-bench/random-del-create.c
+++ b/testcases/kernel/fs/fs-bench/random-del-create.c
@@ -11,7 +11,7 @@
#define FAIL 0
#define SUCCESS 1
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
#define MAXNUM 0x100000
diff --git a/testcases/kernel/fs/scsi/ltpfs/main.c b/testcases/kernel/fs/scsi/ltpfs/main.c
index 2c67c7a47..90a5531ac 100644
--- a/testcases/kernel/fs/scsi/ltpfs/main.c
+++ b/testcases/kernel/fs/scsi/ltpfs/main.c
@@ -38,7 +38,7 @@ int startc = 0;
int showchar[] = { 124, 47, 45, 92, 124, 47, 45, 92 };
int nullFileHandle;
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
int cFileCount, dFileCount, errorCount;
static int disk_space_pool = 0;
--
2.35.1
More information about the ltp
mailing list