From d0495ec8c167e3ddbb15b504874b41f1d14c5792 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 23 Jun 2009 11:25:38 +0100 Subject: xenconsoled: Fix rate-limit calculation overflow leading to console freezes. From: Eric Tessler Signed-off-by: Keir Fraser --- tools/console/daemon/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/console') diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 2475963a58..11e0950595 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -688,7 +688,7 @@ static struct domain *create_domain(int domid) dom->buffer.capacity = 0; dom->buffer.max_capacity = 0; dom->event_count = 0; - dom->next_period = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + RATE_LIMIT_PERIOD; + dom->next_period = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + RATE_LIMIT_PERIOD; dom->next = NULL; dom->ring_ref = -1; @@ -1009,7 +1009,7 @@ void handle_io(void) if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) return; - now = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000); + now = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000); /* Re-calculate any event counter allowances & unblock domains with new allowance */ -- cgit v1.2.3