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

Am 27.05.2012 17:02, schrieb Andreas Färber:
> 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>

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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

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

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=4FC24348.4070100@suse.de \
    --to=afaerber@suse.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).