mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
f018fbac78
commit
2df085bf24
|
@ -31,6 +31,9 @@
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
|
||||||
|
/* Some UNIX lack it in headers & it doesn't hurt to redeclare */
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
# define VIR_FROM_THIS VIR_FROM_NONE
|
# define VIR_FROM_THIS VIR_FROM_NONE
|
||||||
|
|
||||||
static int envsort(const void *a, const void *b)
|
static int envsort(const void *a, const void *b)
|
||||||
|
|
|
@ -58,6 +58,9 @@ main(void)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
/* Some UNIX lack it in headers & it doesn't hurt to redeclare */
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
static int checkoutput(const char *testname,
|
static int checkoutput(const char *testname,
|
||||||
char *prefix)
|
char *prefix)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue