aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorAndreas Färber <andreas.faerber@web.de>2012-05-27 17:02:20 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-05-29 21:00:40 -0500
commiteecae14724b64d43f9a44b9b4e69143961c201a3 (patch)
tree0bb0d6fd7904a1161fb607fc65776ebd8cc412be /qga
parent1c4ad9d2b4b5f2be08588a91e4193d13cc314282 (diff)
qemu-ga: Fix use of environ on Darwin
Use _NSGetEnviron() helper to access the environment. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Charlie Somerville <charlie@charliesomerville.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga')
-rw-r--r--qga/commands-posix.c5
1 files changed, 5 insertions, 0 deletions
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 <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
extern char **environ;
#endif
+#endif
#if defined(__linux__)
#include <mntent.h>