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>
diff --git a/libcutils/klog.c b/libcutils/klog.c
index d69fb10..d3c40df 100644
--- a/libcutils/klog.c
+++ b/libcutils/klog.c
@@ -49,18 +49,24 @@
 
 #define LOG_BUF_MAX 512
 
-void klog_write(int level, const char *fmt, ...)
+void klog_vwrite(int level, const char *fmt, va_list ap)
 {
     char buf[LOG_BUF_MAX];
-    va_list ap;
 
     if (level > klog_level) return;
     if (klog_fd < 0) klog_init();
     if (klog_fd < 0) return;
 
-    va_start(ap, fmt);
     vsnprintf(buf, LOG_BUF_MAX, fmt, ap);
     buf[LOG_BUF_MAX - 1] = 0;
-    va_end(ap);
+
     write(klog_fd, buf, strlen(buf));
 }
+
+void klog_write(int level, const char *fmt, ...)
+{
+    va_list ap;
+    va_start(ap, fmt);
+    klog_vwrite(level, fmt, ap);
+    va_end(ap);
+}