aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2014-03-21 19:42:20 -0400
committerLuiz Capitulino <lcapitulino@redhat.com>2014-04-25 09:19:58 -0400
commit3cb498110b074d21bc7bab41d9d47a6879c5818a (patch)
treec181397b34fe05d3dbfbcfc8120f5bb028fba8bf
parent5caeaedcb05659c521ae3b442959aeaa63d379d6 (diff)
downloadslirp-3cb498110b074d21bc7bab41d9d47a6879c5818a.zip
slirp-3cb498110b074d21bc7bab41d9d47a6879c5818a.tar.gz
slirp-3cb498110b074d21bc7bab41d9d47a6879c5818a.tar.bz2
slirp: Remove default_mon usage
These errors don't seem user initiated, so forcibly printing to the monitor doesn't seem right. Just use error_report. Drop lprint since it's now unused. Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--misc.c13
-rw-r--r--slirp.c8
-rw-r--r--slirp.h2
3 files changed, 6 insertions, 17 deletions
diff --git a/misc.c b/misc.c
index 49d77f8..5762c20 100644
--- a/misc.c
+++ b/misc.c
@@ -129,7 +129,7 @@ int fork_exec(struct socket *so, const char *ex, int do_pty)
if ((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0 ||
bind(s, (struct sockaddr *)&addr, addrlen) < 0 ||
listen(s, 1) < 0) {
- lprint("Error: inet socket: %s\n", strerror(errno));
+ error_report("Error: inet socket: %s", strerror(errno));
closesocket(s);
return 0;
@@ -139,7 +139,7 @@ int fork_exec(struct socket *so, const char *ex, int do_pty)
pid = fork();
switch (pid) {
case -1:
- lprint("Error: fork failed: %s\n", strerror(errno));
+ error_report("Error: fork failed: %s", strerror(errno));
close(s);
return 0;
@@ -235,15 +235,6 @@ char *strdup(str) const char *str;
}
#endif
-void lprint(const char *format, ...)
-{
- va_list args;
-
- va_start(args, format);
- monitor_vprintf(default_mon, format, args);
- va_end(args);
-}
-
void slirp_connection_info(Slirp *slirp, Monitor *mon)
{
const char *const tcpstates[] = {
diff --git a/slirp.c b/slirp.c
index 43f1beb..f002b0a 100644
--- a/slirp.c
+++ b/slirp.c
@@ -138,7 +138,7 @@ int get_dns_addr(struct in_addr *pdns_addr)
return -1;
#ifdef DEBUG
- lprint("IP address of your DNS(s): ");
+ fprintf(stderr, "IP address of your DNS(s): ");
#endif
while (fgets(buff, 512, f) != NULL) {
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
@@ -152,17 +152,17 @@ int get_dns_addr(struct in_addr *pdns_addr)
}
#ifdef DEBUG
else
- lprint(", ");
+ fprintf(stderr, ", ");
#endif
if (++found > 3) {
#ifdef DEBUG
- lprint("(more)");
+ fprintf(stderr, "(more)");
#endif
break;
}
#ifdef DEBUG
else
- lprint("%s", inet_ntoa(tmp_addr));
+ fprintf(stderr, "%s", inet_ntoa(tmp_addr));
#endif
}
}
diff --git a/slirp.h b/slirp.h
index c54f1b1..49fee69 100644
--- a/slirp.h
+++ b/slirp.h
@@ -287,8 +287,6 @@ char *index(const char *, int);
long gethostid(void);
#endif
-void lprint(const char *, ...) GCC_FMT_ATTR(1, 2);
-
#ifndef _WIN32
#include <netdb.h>
#endif