From 8f2a5a0b40fc82126c691d5c30131d908772aab7 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 15 Mar 2013 15:30:25 -0700 Subject: Clean up internal libc logging. We only need one logging API, and I prefer the one that does no allocation and is thus safe to use in any context. Also use O_CLOEXEC when opening the /dev/log files. Move everything logging-related into one header file. Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58 --- libc/netbsd/resolv/res_cache.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libc/netbsd/resolv/res_cache.c') diff --git a/libc/netbsd/resolv/res_cache.c b/libc/netbsd/resolv/res_cache.c index 838e084..a2bc7ca 100644 --- a/libc/netbsd/resolv/res_cache.c +++ b/libc/netbsd/resolv/res_cache.c @@ -170,9 +170,8 @@ #undef XLOG #if DEBUG -# include -# define XLOG(...) \ - __libc_android_log_print(ANDROID_LOG_DEBUG,"libc",__VA_ARGS__) +# include "libc_logging.h" +# define XLOG(...) __libc_format_log(ANDROID_LOG_DEBUG,"libc",__VA_ARGS__) #include #include @@ -708,9 +707,9 @@ static char* _dnsPacket_bprintQR(DnsPacket* packet, char* p, char* end) { #define QQ(x) { DNS_TYPE_##x, #x } - static const struct { + static const struct { const char* typeBytes; - const char* typeString; + const char* typeString; } qTypes[] = { QQ(A), QQ(PTR), QQ(MX), QQ(AAAA), QQ(ALL), @@ -1487,7 +1486,7 @@ _cache_lookup_p( Cache* cache, pnode = &node->hlink; } - return pnode; + return pnode; } /* Add a new entry to the hash table. 'lookup' must be the -- cgit v1.1