From patchwork Thu May 24 18:52:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 86A64B6FA5 for ; Fri, 25 May 2012 04:53:31 +1000 (EST) Received: from localhost ([::1]:37988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXdA9-00086O-FS for incoming@patchwork.ozlabs.org; Thu, 24 May 2012 14:53:29 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=pyTQns9Yd88BICJS9I1S731qD7pEN5ojchq7sMlReeE=; b=tw5zpxyy+Nwxz21QL5WHE3PFDetRfszC5AFo+xyiU+8KU589Q7/n4uhSFWsVRLEBlT VACpPSFsSc5U0UkSKAWuqkdzeH6/AikYerNGPelF9KqjDfq/5c0Fq8RwEet/zdS31H8L qzBb5bCoGJ+3TPsaUEj1cLjsswCbZIeM36v65buzJGWsfEFr4+1/JT3D/Q1/Js0Ax7+F arSmJzvkuVvmDwBL71WmZ33ON2lFXwBMzkN9NyraMttciWwIDD+ddmZgD++ZkzRvJw9g oRmop7GsDIUVZT7L1GNatyMjG8X5Gg+YthGDY+qpKa8P4K7yPe8WxWTUzXB3xuTMNcnW h6JQ== Received: by 10.60.24.7 with SMTP id q7mr442522oef.50.1337885574011; Thu, 24 May 2012 11:52:54 -0700 (PDT) Received: from localhost.localdomain ([32.97.110.59]) by mx.google.com with ESMTPS id h5sm122138obo.21.2012.05.24.11.52.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 May 2012 11:52:53 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Thu, 24 May 2012 13:52:41 -0500 Message-Id: <1337885561-10629-3-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 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> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.173 Cc: aliguori@us.ibm.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH 2/2] qemu-ga: Fix missing environ declaration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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