aboutsummaryrefslogtreecommitdiffstats
path: root/libc/netbsd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-03-15 16:36:37 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-03-15 16:36:37 -0700
commit12ea8005665085ae82c1b233ae93d12855e04b8b (patch)
tree27264105563e73d0a8f58a13257f3512fbf255a9 /libc/netbsd
parente1b0db1392050900e1f38b16ec2c8e213308e267 (diff)
parent5f8292050fc07f4bf9e70f37a807ad028e3cfc87 (diff)
downloadandroid_bionic-12ea8005665085ae82c1b233ae93d12855e04b8b.tar.gz
android_bionic-12ea8005665085ae82c1b233ae93d12855e04b8b.tar.bz2
android_bionic-12ea8005665085ae82c1b233ae93d12855e04b8b.zip
am 5f829205: am c1416647: Merge "Clean up internal libc logging."
* commit '5f8292050fc07f4bf9e70f37a807ad028e3cfc87': Clean up internal libc logging.
Diffstat (limited to 'libc/netbsd')
-rw-r--r--libc/netbsd/resolv/res_cache.c9
-rw-r--r--libc/netbsd/resolv/res_send.c32
-rw-r--r--libc/netbsd/resolv/res_state.c4
3 files changed, 20 insertions, 25 deletions
diff --git a/libc/netbsd/resolv/res_cache.c b/libc/netbsd/resolv/res_cache.c
index 08a25576c..829bf1032 100644
--- a/libc/netbsd/resolv/res_cache.c
+++ b/libc/netbsd/resolv/res_cache.c
@@ -171,9 +171,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>
@@ -707,9 +706,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),
diff --git a/libc/netbsd/resolv/res_send.c b/libc/netbsd/resolv/res_send.c
index ceb2c7782..d407ac8c8 100644
--- a/libc/netbsd/resolv/res_send.c
+++ b/libc/netbsd/resolv/res_send.c
@@ -119,7 +119,7 @@ __RCSID("$NetBSD: res_send.c,v 1.9 2006/01/24 17:41:25 christos Exp $");
# include <resolv_cache.h>
#endif
-#include "logd.h"
+#include "libc_logging.h"
#ifndef DE_CONST
#define DE_CONST(c,v) v = ((c) ? \
@@ -555,7 +555,7 @@ res_nsend(res_state statp,
ns);
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc",
"used send_vc %d\n", n);
}
@@ -567,15 +567,13 @@ res_nsend(res_state statp,
} else {
/* Use datagrams. */
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
- "using send_dg\n");
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc", "using send_dg\n");
}
n = send_dg(statp, buf, buflen, ans, anssiz, &terrno,
ns, &v_circuit, &gotsomewhere);
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
- "used send_dg %d\n",n);
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc", "used send_dg %d\n",n);
}
if (n < 0)
@@ -583,7 +581,7 @@ res_nsend(res_state statp,
if (n == 0)
goto next_ns;
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc",
"time=%d, %d\n",time(NULL), time(NULL)%2);
}
if (v_circuit)
@@ -728,8 +726,7 @@ static int get_timeout(const res_state statp, const int ns)
timeout = 1;
}
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
- "using timeout of %d sec\n", timeout);
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc", "using timeout of %d sec\n", timeout);
}
return timeout;
@@ -751,7 +748,7 @@ send_vc(res_state statp,
void *tmp;
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc", "using send_vc\n");
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc", "using send_vc\n");
}
nsap = get_nsaddr(statp, (size_t)ns);
@@ -952,8 +949,7 @@ connect_with_timeout(int sock, const struct sockaddr *nsap, socklen_t salen, int
timeout = evConsTime((long)sec, 0L);
finish = evAddTime(now, timeout);
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
- " %d send_vc\n", sock);
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc", " %d send_vc\n", sock);
}
res = retrying_select(sock, &rset, &wset, &finish);
@@ -964,7 +960,7 @@ connect_with_timeout(int sock, const struct sockaddr *nsap, socklen_t salen, int
done:
fcntl(sock, F_SETFL, origflags);
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc",
" %d connect_with_timeout returning %s\n", sock, res);
}
return res;
@@ -980,7 +976,7 @@ retrying_select(const int sock, fd_set *readset, fd_set *writeset, const struct
retry:
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc", " %d retying_select\n", sock);
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc", " %d retying_select\n", sock);
}
now = evNowTime();
@@ -1000,7 +996,7 @@ retry:
n = pselect(sock + 1, readset, writeset, NULL, &timeout, NULL);
if (n == 0) {
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, " libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, " libc",
" %d retrying_select timeout\n", sock);
}
errno = ETIMEDOUT;
@@ -1010,7 +1006,7 @@ retry:
if (errno == EINTR)
goto retry;
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc",
" %d retrying_select got error %d\n",sock, n);
}
return n;
@@ -1020,7 +1016,7 @@ retry:
if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &error, &len) < 0 || error) {
errno = error;
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc",
" %d retrying_select dot error2 %d\n", sock, errno);
}
@@ -1028,7 +1024,7 @@ retry:
}
}
if (DBG) {
- __libc_android_log_print(ANDROID_LOG_DEBUG, "libc",
+ __libc_format_log(ANDROID_LOG_DEBUG, "libc",
" %d retrying_select returning %d for %d\n",sock, n);
}
diff --git a/libc/netbsd/resolv/res_state.c b/libc/netbsd/resolv/res_state.c
index efaa519a1..32ffdcaf8 100644
--- a/libc/netbsd/resolv/res_state.c
+++ b/libc/netbsd/resolv/res_state.c
@@ -42,9 +42,9 @@
#define DEBUG 0
#if DEBUG
-# include <logd.h>
+# include "libc_logging.h"
# include <unistd.h> /* for gettid() */
-# define D(...) __libc_android_log_print(ANDROID_LOG_DEBUG,"libc", __VA_ARGS__)
+# define D(...) __libc_format_log(ANDROID_LOG_DEBUG,"libc", __VA_ARGS__)
#else
# define D(...) do{}while(0)
#endif