Added forgotten -Wall -Wextra compilation options and fixed
authorJarkko Sakkinen <jarkko.sakkinen@iki.fi>
Thu, 10 Nov 2011 15:49:40 +0000 (17:49 +0200)
committerJarkko Sakkinen <jarkko.sakkinen@iki.fi>
Thu, 10 Nov 2011 15:49:40 +0000 (17:49 +0200)
warnings.

libsmack/Makefile.am
libsmack/libsmack.c

index 0f51e65..c35a959 100644 (file)
@@ -1,6 +1,8 @@
 ACLOCAL_AMFLAGS = -I m4
 AM_MAKEFLAGS = --no-print-directory
 
+AM_CFLAGS = -Wall -Wextra
+
 EXTRA_DIST = libsmack.sym
 
 lib_LTLIBRARIES = libsmack.la
index a33b070..ca64401 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <unistd.h>
 
 #define LABEL_LEN 23
 #define LOAD_LEN (2 * (LABEL_LEN + 1) + ACC_LEN)
@@ -180,12 +181,12 @@ int smack_accesses_save(struct smack_accesses *handle, int fd)
 
 int smack_accesses_apply(struct smack_accesses *handle)
 {
-       accesses_apply(handle, 0);
+       return accesses_apply(handle, 0);
 }
 
 int smack_accesses_clear(struct smack_accesses *handle)
 {
-       accesses_apply(handle, 1);
+       return accesses_apply(handle, 1);
 }
 
 int smack_accesses_add(struct smack_accesses *handle, const char *subject,
@@ -336,7 +337,7 @@ static int accesses_apply(struct smack_accesses *handle, int clear)
 
 static inline int access_type_to_int(const char *access_type)
 {
-       int i, count;
+       int i;
        unsigned access;
 
        access = 0;