aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-06-23 19:15:55 -0700
committerRichard Henderson <rth@twiddle.net>2016-08-05 21:44:40 +0530
commitbdfb460ef77500f7b186759b585f06ff2120929d (patch)
tree0dad5b3169d975054658d146eb0ffa2fe0454607 /util
parentc70fbf0a9938baf3b4f843355a77c17a7e945b98 (diff)
tcg: Include liveness info in the dumps
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'util')
-rw-r--r--util/log.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/util/log.c b/util/log.c
index b6c75b1102..9f0844481c 100644
--- a/util/log.c
+++ b/util/log.c
@@ -32,15 +32,22 @@ int qemu_loglevel;
static int log_append = 0;
static GArray *debug_regions;
-void qemu_log(const char *fmt, ...)
+/* Return the number of characters emitted. */
+int qemu_log(const char *fmt, ...)
{
- va_list ap;
-
- va_start(ap, fmt);
+ int ret = 0;
if (qemu_logfile) {
- vfprintf(qemu_logfile, fmt, ap);
+ va_list ap;
+ va_start(ap, fmt);
+ ret = vfprintf(qemu_logfile, fmt, ap);
+ va_end(ap);
+
+ /* Don't pass back error results. */
+ if (ret < 0) {
+ ret = 0;
+ }
}
- va_end(ap);
+ return ret;
}
static bool log_uses_own_buffers;