libselinux: fix unused variable error

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 <william.c.roberts@intel.com>
This commit is contained in:
William Roberts 2016-09-28 11:53:57 -04:00 committed by Stephen Smalley
parent c44895c82c
commit 2ec56b3da9

View File

@ -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 =