From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXd9e-0006iK-Gw for qemu-devel@nongnu.org; Thu, 24 May 2012 14:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXd9c-00042t-3g for qemu-devel@nongnu.org; Thu, 24 May 2012 14:52:58 -0400 Received: from mail-gh0-f173.google.com ([209.85.160.173]:61704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXd9b-00042B-TW for qemu-devel@nongnu.org; Thu, 24 May 2012 14:52:56 -0400 Received: by ghrr14 with SMTP id r14so81659ghr.4 for ; Thu, 24 May 2012 11:52:54 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Thu, 24 May 2012 13:52:41 -0500 Message-Id: <1337885561-10629-3-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1337885561-10629-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1337885561-10629-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/2] qemu-ga: Fix missing environ declaration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, lcapitulino@redhat.com From: Luiz Capitulino Commit 3674838cd05268954bb6473239cd7f700a79bf0f uses the environ global variable, but is relying on environ to be declared somewhere else. This worked for me because on F16 environ is declared in , but that doesn't happen in OpenBSD for example, causing a build failure. This commit fixes the build error by declaring environ if it hasn't being declared yet. Also fixes a build warning due to a missing include. Signed-off-by: Luiz Capitulino Signed-off-by: Michael Roth --- qga/commands-posix.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 7664be1..dab3bf9 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -14,12 +14,17 @@ #include #include #include +#include #include "qga/guest-agent-core.h" #include "qga-qmp-commands.h" #include "qerror.h" #include "qemu-queue.h" #include "host-utils.h" +#ifndef CONFIG_HAS_ENVIRON +extern char **environ; +#endif + #if defined(__linux__) #include #include @@ -27,7 +32,6 @@ #include #include #include -#include #if defined(__linux__) && defined(FIFREEZE) #define CONFIG_FSFREEZE -- 1.7.4.1