From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYf4f-0002Bh-NX for qemu-devel@nongnu.org; Sun, 27 May 2012 11:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYf4d-0003yk-UK for qemu-devel@nongnu.org; Sun, 27 May 2012 11:08:05 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53273 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYf4d-0003yg-Ni for qemu-devel@nongnu.org; Sun, 27 May 2012 11:08:03 -0400 Message-ID: <4FC24348.4070100@suse.de> Date: Sun, 27 May 2012 17:07:52 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1338130940-43034-1-git-send-email-andreas.faerber@web.de> In-Reply-To: <1338130940-43034-1-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.1] qemu-ga: Fix use of environ on Darwin List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: Charlie Somerville , qemu-devel@nongnu.org Am 27.05.2012 17:02, schrieb Andreas F=C3=A4rber: > Use _NSGetEnviron() helper to access the environment. >=20 > Signed-off-by: Andreas F=C3=A4rber > Cc: Charlie Somerville > --- > Michael, can you please append this to your qemu-ga PULL? > =20 > qga/commands-posix.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) >=20 > 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" > =20 > #ifndef CONFIG_HAS_ENVIRON > +#ifdef __APPLE__ > +#include > +#define environ (*_NSGetEnviron()) > +#else > extern char **environ; > #endif > +#endif > =20 > #if defined(__linux__) > #include For 1.2 it might also be a good idea to move this block to osdep.h, so that it doesn't get duplicated when needed somewhere else. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg