From mboxrd@z Thu Jan 1 00:00:00 1970
From: Peter
Subject: xentop.c trivial fix
Date: Mon, 08 Jan 2007 09:43:18 +1300
Message-ID: <45A15B66.9060008@rimuhosting.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-path:
List-Unsubscribe: ,
List-Post:
List-Help:
List-Subscribe: ,
Sender: xen-devel-bounces@lists.xensource.com
Errors-To: xen-devel-bounces@lists.xensource.com
To: xen-devel@lists.xensource.com
List-Id: xen-devel@lists.xenproject.org
Hi.
I run:
xentop --delay=30 --iterations 2 --batch
I get output, 30 second delay, output, 30 second delay, exit.
I want output, 30 seconds delay, output, exit.
The following patch implements that behavior and I think this is likely
the desired behavior anyway. i.e. just a trivial bug in code.
# diff -U5 xentop.c.orig xentop.c
--- xentop.c.orig 2006-12-29 08:05:13.000000000 +0000
+++ xentop.c 2006-12-29 08:06:40.000000000 +0000
@@ -1053,13 +1053,13 @@
} else {
do {
gettimeofday(&curtime, NULL);
top();
oldtime = curtime;
- sleep(delay);
if ((!loop) && !(--iterations))
break;
+ sleep(delay);
} while (1);
}
/* Cleanup occurs in cleanup(), so no work to do here. */
Regards, Peter