qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] monitor-mux: fix timestamp prefixes


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH] monitor-mux: fix timestamp prefixes
Date: Tue, 20 Jan 2009 13:56:35 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

rt_clock returns milliseconds. Fix mux'ed monitor terminal timestamps
accordingly.

Signed-off-by: Jan Kiszka <address@hidden>
---

 qemu-char.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index ac431c7..f849187 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -241,13 +241,13 @@ static int mux_chr_write(CharDriverState *chr, const 
uint8_t *buf, int len)
                 if (term_timestamps_start == -1)
                     term_timestamps_start = ti;
                 ti -= term_timestamps_start;
-                secs = ti / 1000000000;
+                secs = ti / 1000;
                 snprintf(buf1, sizeof(buf1),
                          "[%02d:%02d:%02d.%03d] ",
                          secs / 3600,
                          (secs / 60) % 60,
                          secs % 60,
-                         (int)((ti / 1000000) % 1000));
+                         (int)(ti % 1000));
                 d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1));
             }
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]