From 73c046883b8ec79e9ef2b7261621a65acdfdc3b8 Mon Sep 17 00:00:00 2001 Message-Id: <73c046883b8ec79e9ef2b7261621a65acdfdc3b8.1342518105.git.minovotn@redhat.com> In-Reply-To: <27a73856ecc481c66c7afac8171f753887f32e31.1342518105.git.minovotn@redhat.com> References: <27a73856ecc481c66c7afac8171f753887f32e31.1342518105.git.minovotn@redhat.com> From: Luiz Capitulino Date: Tue, 5 Jun 2012 14:58:49 +0200 Subject: [PATCH 39/41] qemu-ga: Fix missing environ declaration RH-Author: Luiz Capitulino Message-id: <1338908331-15633-35-git-send-email-lcapitulino@redhat.com> Patchwork-id: 39931 O-Subject: [PATCH RHEL6.4 qemu-kvm 34/36] qemu-ga: Fix missing environ declaration Bugzilla: 827612 RH-Acked-by: Paolo Bonzini RH-Acked-by: Juan Quintela RH-Acked-by: Laszlo Ersek 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 (cherry picked from commit 2c02cbf6e929c20545b46feb5ecde9c86877198a) Signed-off-by: Luiz Capitulino --- qga/commands-posix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Signed-off-by: Michal Novotny --- qga/commands-posix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index e351475..2e0a888 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -35,6 +35,10 @@ #include "qemu-queue.h" #include "host-utils.h" +#ifndef CONFIG_HAS_ENVIRON +extern char **environ; +#endif + /* file-* commands are compile-time disabled for RHEL/RHEV. * To enable, set to '1' */ #define QGA_FILE_OPS 0 -- 1.7.10.4