aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-06-23 11:25:38 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-06-23 11:25:38 +0100
commitd0495ec8c167e3ddbb15b504874b41f1d14c5792 (patch)
treec9bf9ace78f2e09e61ed6abfab903c4630b3ef46 /tools/console
parentdcf18dfcc4b2f0478446e0064a03fe2aaf1952b1 (diff)
downloadxen-d0495ec8c167e3ddbb15b504874b41f1d14c5792.tar.gz
xen-d0495ec8c167e3ddbb15b504874b41f1d14c5792.tar.bz2
xen-d0495ec8c167e3ddbb15b504874b41f1d14c5792.zip
xenconsoled: Fix rate-limit calculation overflow leading to console freezes.
From: Eric Tessler <eric@3tera.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/console')
-rw-r--r--tools/console/daemon/io.c4
1 files changed, 2 insertions, 2 deletions
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 */