Skip to content

Commit

Permalink
qemu-ga: Fix use of environ on Darwin
Browse files Browse the repository at this point in the history
Use _NSGetEnviron() helper to access the environment.

Signed-off-by: Andreas Färber <[email protected]>
Cc: Charlie Somerville <[email protected]>
Signed-off-by: Michael Roth <[email protected]>
  • Loading branch information
afaerber authored and mdroth committed May 30, 2012
1 parent 1c4ad9d commit eecae14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qga/commands-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit eecae14

Please sign in to comment.