>From 4a3f4cff8aa27fe3810d621d20bf90f18ca8e2d5 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Wed, 23 May 2012 11:33:51 -0300 Subject: [PATCH] qemu-ga: Fix missing environ declarion Commit 3674838cd05268954bb6473239cd7f700a79bf0f uses the environ global variable, but is relying on it to be declared somewhere else. This works for Linux because _GNU_SOURCE declares it, but it brakes for system where _GNU_SOURCE is not declared, such as OpenBSD. Fix it by declaring environ when _GNU_SOURCE is not defined. Signed-off-by: Luiz Capitulino --- qga/commands-posix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 7664be1..304ffa8 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -12,6 +12,7 @@ */ #include +#include #include #include #include "qga/guest-agent-core.h" @@ -20,6 +21,10 @@ #include "qemu-queue.h" #include "host-utils.h" +#ifndef _GNU_SOURCE +extern char **environ; +#endif + #if defined(__linux__) #include #include -- 1.7.9.2.384.g4a92a