Some UNIX platforms don't declare 'environ' in their
header files. We can unconditionally declare it ourselves
to avoid this problem.

There is no need to do this in the aa-helper code
since that is Linux only code.

Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
---
 tests/commandhelper.c | 3 +++
 tests/commandtest.c   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 77cbcd4680..a7a3c44e33 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -31,6 +31,9 @@
 
 #ifndef WIN32
 
+/* Some UNIX lack it in headers & it doesn't hurt to redeclare */
+extern char **environ;
+
 # define VIR_FROM_THIS VIR_FROM_NONE
 
 static int envsort(const void *a, const void *b)
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 5df1aa4221..cc8676811e 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -58,6 +58,9 @@ main(void)
 
 #else
 
+/* Some UNIX lack it in headers & it doesn't hurt to redeclare */
+extern char **environ;
+
 static int checkoutput(const char *testname,
                        char *prefix)
 {
-- 
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to