From patchwork Wed Sep 28 15:53:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Roberts, William C" X-Patchwork-Id: 9354139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 20CFA60757 for ; Wed, 28 Sep 2016 15:54:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11462296F0 for ; Wed, 28 Sep 2016 15:54:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0646529705; Wed, 28 Sep 2016 15:54:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (smtp.nsa.gov [8.44.101.9]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6710D296F0 for ; Wed, 28 Sep 2016 15:54:24 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,410,1470700800"; d="scan'208";a="19629039" IronPort-PHdr: =?us-ascii?q?9a23=3A2EuoBxI8A2Ydn2h+ftmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUI/zxwZ3uMQTl6Ol3ixeRBMOAuqgC0rWd4vuocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIs?= =?us-ascii?q?YL+kQMiL0I/mjKibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKK?= =?us-ascii?q?x8zGJsIk+PzV6nvp/jtKN592xsn95pt4sZCeSpN5g/GKdVCDUgLnAd+NzgtR6F?= =?us-ascii?q?SxCGoHQbTCFeiRdBBQTf6xD2G5PwqTfSqvt22C7cO9b/C78zR3Dq9KtwYAP5gy?= =?us-ascii?q?cAcTgi+SfYjdIjorhcpUe+phh7wofRJorTLv10c7nBZvsbQ3ZMWoBaUCkSUcuH?= =?us-ascii?q?c4ITAr9Zbq5jpI7nqg5L9EOz?= X-IPAS-Result: =?us-ascii?q?A2HpBAAp5+tX/wHyM5BdHAEBBAEBCgEBFwEBBAEBCgEBgxQ?= =?us-ascii?q?BAQEBAR6BU6YFlEYjhgUegUtMAQEBAQEBAQECAQJbJ4IyBAMTBYIYAiAEDRogD?= =?us-ascii?q?gMJAhcIBQIiBAICAgEBLRUBFwcLBRgEiCywJI0sgQaHNYZkAhEBOYJngloFmXa?= =?us-ascii?q?PawKJe4VtApBpVIUlVgGFAg8XYYEoAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 28 Sep 2016 15:54:22 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u8SFsG1Z002675; Wed, 28 Sep 2016 11:54:17 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u8SFsARn003928 for ; Wed, 28 Sep 2016 11:54:10 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u8SFs9vY002655; Wed, 28 Sep 2016 11:54:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1C+AwDx5utX/yNjr8ZdGgEBAQECAQEBAQgBAQEBgz8BAQEBAR6BU7ZAhBUUhgqBaUwBAgEBAQEBAl6FMgQLAUYwBQImAmASiE2wI4x7AQslgQaHNYZkTYJngloFmXaPawKPaAKQaVSFJSI0AYUCgi8BAQE X-IPAS-Result: A1C+AwDx5utX/yNjr8ZdGgEBAQECAQEBAQgBAQEBgz8BAQEBAR6BU7ZAhBUUhgqBaUwBAgEBAQEBAl6FMgQLAUYwBQImAmASiE2wI4x7AQslgQaHNYZkTYJngloFmXaPawKPaAKQaVSFJSI0AYUCgi8BAQE X-IronPort-AV: E=Sophos;i="5.30,410,1470715200"; d="scan'208";a="5733857" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 28 Sep 2016 11:54:09 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AeJSLiB2+fH4BYqyismDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?sekXL/ad9pjvdHbS+e9qxAeQG96KsbQd1KGH6OjJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMz?= =?us-ascii?q?fbWvXNeNxJXsn8mJuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM8?= =?us-ascii?q?5fxGdvOE7B102kvpT41NdZ/i9Ro/Ms8dJbGeW/JvxgDO9uNzM8L2053sDgtAGZ?= =?us-ascii?q?BUvTvjpPGlkRxwFFBwnD8QHSQob6siy8sPF0niadI4m+Vr09Xzi46KZnDRvpkz?= =?us-ascii?q?svKy8y8GaRjNd5yq1cvlbpvBBk65LFa4GScvxld+XSes1Ja3BGW5NOVihFA4q5?= =?us-ascii?q?KYBJFe0LMPxEtKH8oUcDqV21Agz/V6vU1jZUiyqujuUB2OM7HFSDglQt?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0G3AwAp5+tX/yNjr8ZdGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFwEBBAEBCgEBgxQBAQEBAR6BU6YFkDuEFRSGCoFpTAEBAQEBAQEBAgE?= =?us-ascii?q?CWyeCMgQBFQWCOgQLAUYwBQImAmASiE2wJIx7AQsBJIEGhzWGZE2CZ4JaBZl2j?= =?us-ascii?q?2sCj2gCkGlUhSUiNAGFAm6BQQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0G3AwAp5+tX/yNjr8ZdGgEBAQECAQEBAQgBAQEBFwEBBAE?= =?us-ascii?q?BCgEBgxQBAQEBAR6BU6YFkDuEFRSGCoFpTAEBAQEBAQEBAgECWyeCMgQBFQWCO?= =?us-ascii?q?gQLAUYwBQImAmASiE2wJIx7AQsBJIEGhzWGZE2CZ4JaBZl2j2sCj2gCkGlUhSU?= =?us-ascii?q?iNAGFAm6BQQEBAQ?= X-IronPort-AV: E=Sophos;i="5.30,410,1470700800"; d="scan'208";a="19629025" Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP; 28 Sep 2016 15:54:08 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga002-icc.fm.intel.com with ESMTP; 28 Sep 2016 08:54:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,410,1470726000"; d="scan'208";a="884734004" Received: from rkherrer-mobl.amr.corp.intel.com (HELO wcrobert-MOBL1.amr.corp.intel.com) ([10.254.66.125]) by orsmga003.jf.intel.com with ESMTP; 28 Sep 2016 08:54:06 -0700 From: william.c.roberts@intel.com To: selinux@tycho.nsa.gov, seandroid-list@tycho.nsa.gov, sds@tycho.nsa.gov Subject: [PATCH] libselinux: fix unused variable error Date: Wed, 28 Sep 2016 11:53:57 -0400 Message-Id: <1475078037-20217-1-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: William Roberts When building for Android, this error manifests itself: label_file.c:570:7: error: unused variable ‘subs_file’ [-Werror=unused-variable] char subs_file[PATH_MAX + 1]; Fix it by moving the variable into the ifdef'd usage block. Signed-off-by: William Roberts --- libselinux/src/label_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index adf3dcc..a4dc3cd 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -567,7 +567,6 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts, struct saved_data *data = (struct saved_data *)rec->data; const char *path = NULL; const char *prefix = NULL; - char subs_file[PATH_MAX + 1]; int status = -1, baseonly = 0; /* Process arguments */ @@ -585,6 +584,7 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts, } #if !defined(BUILD_HOST) && !defined(ANDROID) + char subs_file[PATH_MAX + 1]; /* Process local and distribution substitution files */ if (!path) { rec->dist_subs =