qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <andreas.faerber@web.de>,
	"Charlie Somerville" <charlie@charliesomerville.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH for-1.1] qemu-ga: Fix use of environ on Darwin
Date: Sun, 27 May 2012 17:02:20 +0200	[thread overview]
Message-ID: <1338130940-43034-1-git-send-email-andreas.faerber@web.de> (raw)

Use _NSGetEnviron() helper to access the environment.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Charlie Somerville <charlie@charliesomerville.com>
---
 Michael, can you please append this to your qemu-ga PULL?
 
 qga/commands-posix.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index dab3bf9..4a71c27 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>
-- 
1.7.5.3

             reply	other threads:[~2012-05-27 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-27 15:02 Andreas Färber [this message]
2012-05-27 15:07 ` [Qemu-devel] [PATCH for-1.1] qemu-ga: Fix use of environ on Darwin Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338130940-43034-1-git-send-email-andreas.faerber@web.de \
    --to=andreas.faerber@web.de \
    --cc=charlie@charliesomerville.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).