From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPG9m-0007RF-Nh for qemu-devel@nongnu.org; Tue, 20 Jan 2009 07:56:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPG9j-0007QT-Sf for qemu-devel@nongnu.org; Tue, 20 Jan 2009 07:56:37 -0500 Received: from [199.232.76.173] (port=47577 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPG9j-0007QI-L3 for qemu-devel@nongnu.org; Tue, 20 Jan 2009 07:56:35 -0500 Received: from gecko.sbs.de ([194.138.37.40]:16502) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LPG9j-0004Un-1c for qemu-devel@nongnu.org; Tue, 20 Jan 2009 07:56:35 -0500 Received: from mail2.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n0KCuUoP016386 for ; Tue, 20 Jan 2009 13:56:30 +0100 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail2.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n0KCuUgJ009443 for ; Tue, 20 Jan 2009 13:56:30 +0100 Message-ID: <4975CA03.3070700@siemens.com> Date: Tue, 20 Jan 2009 13:56:35 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] monitor-mux: fix timestamp prefixes Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" rt_clock returns milliseconds. Fix mux'ed monitor terminal timestamps accordingly. Signed-off-by: Jan Kiszka --- 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)); } }