summaryrefslogtreecommitdiffstats
path: root/include/cutils
diff options
context:
space:
mode:
authorStephen Smalley <sds@tycho.nsa.gov>2014-02-12 16:17:00 -0500
committerStephen Smalley <sds@tycho.nsa.gov>2014-02-19 09:15:09 -0500
commiteb3f421e028608e37e4eb814351f03b99ae55900 (patch)
tree030a4b7c930994a5bee836f0780aadf87dabac25 /include/cutils
parent27fd413d6d02a53c453cf926717b67e9a8d1eb32 (diff)
downloadsystem_core-eb3f421e028608e37e4eb814351f03b99ae55900.zip
system_core-eb3f421e028608e37e4eb814351f03b99ae55900.tar.gz
system_core-eb3f421e028608e37e4eb814351f03b99ae55900.tar.bz2
Enable building init with -Wall -Werror.
Eliminates various warnings from SELinux-related code. Bug: 12587913 Change-Id: I28921f0ebd934324436609540d95ccef58552b64 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Diffstat (limited to 'include/cutils')
-rw-r--r--include/cutils/klog.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/cutils/klog.h b/include/cutils/klog.h
index ba728ac..4bcdd09 100644
--- a/include/cutils/klog.h
+++ b/include/cutils/klog.h
@@ -18,6 +18,7 @@
#define _CUTILS_KLOG_H_
#include <sys/cdefs.h>
+#include <stdarg.h>
__BEGIN_DECLS
@@ -26,14 +27,21 @@ void klog_set_level(int level);
void klog_close(void);
void klog_write(int level, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
+void klog_vwrite(int level, const char *fmt, va_list ap);
__END_DECLS
-#define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x)
-#define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x)
-#define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x)
-#define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x)
-#define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x)
+#define KLOG_ERROR_LEVEL 3
+#define KLOG_WARNING_LEVEL 4
+#define KLOG_NOTICE_LEVEL 5
+#define KLOG_INFO_LEVEL 6
+#define KLOG_DEBUG_LEVEL 7
+
+#define KLOG_ERROR(tag,x...) klog_write(KLOG_ERROR_LEVEL, "<3>" tag ": " x)
+#define KLOG_WARNING(tag,x...) klog_write(KLOG_WARNING_LEVEL, "<4>" tag ": " x)
+#define KLOG_NOTICE(tag,x...) klog_write(KLOG_NOTICE_LEVEL, "<5>" tag ": " x)
+#define KLOG_INFO(tag,x...) klog_write(KLOG_INFO_LEVEL, "<6>" tag ": " x)
+#define KLOG_DEBUG(tag,x...) klog_write(KLOG_DEBUG_LEVEL, "<7>" tag ": " x)
#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */