diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2014-02-12 16:17:00 -0500 |
---|---|---|
committer | Stephen Smalley <sds@tycho.nsa.gov> | 2014-02-19 09:15:09 -0500 |
commit | eb3f421e028608e37e4eb814351f03b99ae55900 (patch) | |
tree | 030a4b7c930994a5bee836f0780aadf87dabac25 /libcutils | |
parent | 27fd413d6d02a53c453cf926717b67e9a8d1eb32 (diff) | |
download | system_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 'libcutils')
-rw-r--r-- | libcutils/klog.c | 14 |
1 files changed, 10 insertions, 4 deletions
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 @@ void klog_init(void) #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); +} |