summaryrefslogtreecommitdiffstats
path: root/libc/netbsd/resolv/res_cache.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-03-15 15:30:25 -0700
committerElliott Hughes <enh@google.com>2013-03-15 16:12:58 -0700
commit8f2a5a0b40fc82126c691d5c30131d908772aab7 (patch)
tree0b29a5dc82395c076387edb5af9ca271a91264c0 /libc/netbsd/resolv/res_cache.c
parente23ed8c6441389a79c6504295184f7249e01a197 (diff)
downloadbionic-8f2a5a0b40fc82126c691d5c30131d908772aab7.zip
bionic-8f2a5a0b40fc82126c691d5c30131d908772aab7.tar.gz
bionic-8f2a5a0b40fc82126c691d5c30131d908772aab7.tar.bz2
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
Diffstat (limited to 'libc/netbsd/resolv/res_cache.c')
-rw-r--r--libc/netbsd/resolv/res_cache.c11
1 files changed, 5 insertions, 6 deletions
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 <logd.h>
-# 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 <stdio.h>
#include <stdarg.h>
@@ -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