mirror of https://gitee.com/openkylin/qemu.git
slirp: replace some fprintf() with DEBUG_MISC
Remove some clutter, and avoids direct call to fprintf(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
b0866f0c50
commit
7176151874
|
@ -164,9 +164,7 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr,
|
||||||
if (!f)
|
if (!f)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef DEBUG
|
DEBUG_MISC("IP address of your DNS(s): ");
|
||||||
fprintf(stderr, "IP address of your DNS(s): ");
|
|
||||||
#endif
|
|
||||||
while (fgets(buff, 512, f) != NULL) {
|
while (fgets(buff, 512, f) != NULL) {
|
||||||
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
|
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
|
||||||
char *c = strchr(buff2, '%');
|
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;
|
*scope_id = if_index;
|
||||||
}
|
}
|
||||||
*cached_time = curtime;
|
*cached_time = curtime;
|
||||||
|
} else {
|
||||||
|
DEBUG_MISC(", ");
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
|
||||||
else
|
|
||||||
fprintf(stderr, ", ");
|
|
||||||
#endif
|
|
||||||
if (++found > 3) {
|
if (++found > 3) {
|
||||||
#ifdef DEBUG
|
DEBUG_MISC("(more)");
|
||||||
fprintf(stderr, "(more)");
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -206,7 +201,7 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr,
|
||||||
if (!res) {
|
if (!res) {
|
||||||
res = "(string conversion error)";
|
res = "(string conversion error)";
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%s", res);
|
DEBUG_MISC("%s", res);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue