From: Andreas Färber Date: Sun, 27 May 2012 15:02:20 +0000 (+0200) Subject: qemu-ga: Fix use of environ on Darwin X-Git-Tag: pull-nvme-20200902~8008^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=eecae14724b64d43f9a44b9b4e69143961c201a3;p=qemu-nvme.git qemu-ga: Fix use of environ on Darwin Use _NSGetEnviron() helper to access the environment. Signed-off-by: Andreas Färber Cc: Charlie Somerville Signed-off-by: Michael Roth --- diff --git a/qga/commands-posix.c b/qga/commands-posix.c index dab3bf9c98..4a71c27c4a 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -22,8 +22,13 @@ #include "host-utils.h" #ifndef CONFIG_HAS_ENVIRON +#ifdef __APPLE__ +#include +#define environ (*_NSGetEnviron()) +#else extern char **environ; #endif +#endif #if defined(__linux__) #include