[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC |
Date: |
Mon, 14 Jan 2019 23:52:52 +0100 |
From: Marc-André Lureau <address@hidden>
Remove some clutter, and avoids direct call to fprintf().
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/slirp.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/slirp/slirp.c b/slirp/slirp.c
index 7091c3998a..ce5f571d0f 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -164,9 +164,7 @@ static int get_dns_addr_resolv_conf(int af, void
*pdns_addr, void *cached_addr,
if (!f)
return -1;
-#ifdef DEBUG
- fprintf(stderr, "IP address of your DNS(s): ");
-#endif
+ DEBUG_MISC("IP address of your DNS(s): ");
while (fgets(buff, 512, f) != NULL) {
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
char *c = strchr(buff2, '%');
@@ -188,15 +186,12 @@ static int get_dns_addr_resolv_conf(int af, void
*pdns_addr, void *cached_addr,
*scope_id = if_index;
}
*cached_time = curtime;
+ } else {
+ DEBUG_MISC(", ");
}
-#ifdef DEBUG
- else
- fprintf(stderr, ", ");
-#endif
+
if (++found > 3) {
-#ifdef DEBUG
- fprintf(stderr, "(more)");
-#endif
+ DEBUG_MISC("(more)");
break;
}
#ifdef DEBUG
@@ -206,7 +201,7 @@ static int get_dns_addr_resolv_conf(int af, void
*pdns_addr, void *cached_addr,
if (!res) {
res = "(string conversion error)";
}
- fprintf(stderr, "%s", res);
+ DEBUG_MISC("%s", res);
}
#endif
}
--
2.20.1
- [Qemu-devel] [PULL 32/65] slirp: replace compile time DO_KEEPALIVE, (continued)
- [Qemu-devel] [PULL 32/65] slirp: replace compile time DO_KEEPALIVE, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 31/65] slirp: replace SIZEOF_CHAR_P with glib equivalent, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 37/65] slirp: remove #if notdef dead code, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 40/65] slirp: remove dead TCP_ACK_HACK code, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 38/65] slirp: remove unused sbflush(), Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 43/65] glib-compat: add g_spawn_async_with_fds() fallback, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 46/65] slirp: Enable fork_exec support on Windows, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 48/65] slirp: rename exec_list, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 36/65] slirp: add a callback to log guest errors, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 41/65] slirp: replace ARRAY_SIZE with G_N_ELEMENTS, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC,
Samuel Thibault <=
- [Qemu-devel] [PULL 42/65] net: do not depend on slirp internals, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 45/65] slirp: replace error_report() with g_critical(), Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 49/65] slirp: use virtual time for packet expiration, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 64/65] slirp: Mark debugging calls as unlikely, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 61/65] build-sys: use a separate slirp-obj-y && slirp.mo, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 62/65] slirp: set G_LOG_DOMAIN, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 39/65] slirp: NULL is defined by stddef.h, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 34/65] slirp: replace error_report() with g_critical(), Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 35/65] slirp: improve a bit the debug macros, Samuel Thibault, 2019/01/14