[patch] libselinux: fix EMBEDDED=y build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix EMBEDDED=y build for libselinux.

Before:
$ make EMBEDDED=y > out
cc1: warnings being treated as errors
load_policy.c: In function ‘selinux_mkload_policy’:
load_policy.c:59: warning: unused variable ‘i’
load_policy.c:59: warning: unused variable ‘len’
load_policy.c:59: warning: unused variable ‘values’
load_policy.c:54: warning: unused variable ‘names’
make[1]: *** [load_policy.o] Error 1

After:
$ make EMBEDDED=y > out
$ make clean all > out

Signed-off-by:  Stephen Smalley <sds@xxxxxxxxxxxxx>

---

 libselinux/src/load_policy.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
index 63f6609..affe37b 100644
--- a/libselinux/src/load_policy.c
+++ b/libselinux/src/load_policy.c
@@ -51,12 +51,12 @@ int selinux_mkload_policy(int preservebools)
 	int kernvers = security_policyvers();
 	int maxvers = kernvers, minvers = DEFAULT_POLICY_VERSION, vers;
 	int setlocaldefs = load_setlocaldefs;
-	char path[PATH_MAX], **names;
+	char path[PATH_MAX];
 	struct stat sb;
 	struct utsname uts;
 	size_t size;
 	void *map, *data;
-	int fd, rc = -1, *values, len, i, prot;
+	int fd, rc = -1, prot;
 	sepol_policydb_t *policydb;
 	sepol_policy_file_t *pf;
 	int usesepol = 0;
@@ -251,6 +251,8 @@ checkbool:
 		
 #ifndef DISABLE_BOOL
 		if (preservebools) {
+			int *values, len, i;
+			char **names;
 			rc = security_get_boolean_names(&names, &len);
 			if (!rc) {
 				values = malloc(sizeof(int) * len);

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux