tests: always declare environ

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.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-01-07 16:16:19 +00:00
parent f018fbac78
commit 2df085bf24
2 changed files with 6 additions and 0 deletions

View File

@ -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)

View File

@ -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)
{