[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-1.1] qemu-ga: Fix use of environ on Darwin
From: |
Andreas Färber |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 |
Am 27.05.2012 17:02, schrieb Andreas Färber:
> Use _NSGetEnviron() helper to access the environment.
>
> Signed-off-by: Andreas Färber <address@hidden>
> Cc: Charlie Somerville <address@hidden>
> ---
> 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