From bdfb460ef77500f7b186759b585f06ff2120929d Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 23 Jun 2016 19:15:55 -0700 Subject: tcg: Include liveness info in the dumps Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- util/log.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'util/log.c') diff --git a/util/log.c b/util/log.c index b6c75b1..9f08444 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; -- cgit v1.1