procps/procps-ng-3.3.10-xen.dif

34 lines
1.1 KiB
Plaintext
Raw Normal View History

---
vmstat.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- src/vmstat.c
+++ src/vmstat.c 2022-03-29 09:21:41.156855432 +0000
@@ -357,7 +357,7 @@ static void new_format(void)
unsigned long pgpgin[2], pgpgout[2], pswpin[2] = {0,0}, pswpout[2];
unsigned int sleep_half;
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
- int debt = 0; /* handle idle ticks running backwards */
+ long long debt = 0; /* handle idle ticks running backwards */
struct tm *tm_ptr;
time_t the_time;
char timebuf[32];
@@ -484,12 +484,12 @@ static void new_format(void)
/* idle can run backwards for a moment -- kernel "feature" */
if (debt) {
- cpu_idl = (int)cpu_idl + debt;
- debt = 0;
+ cpu_idl = cpu_idl + debt;
+ debt = 0LL;
}
- if ((int)cpu_idl < 0) {
- debt = (int)cpu_idl;
- cpu_idl = 0;
+ if (cpu_idl < 0) {
+ debt = cpu_idl;
+ cpu_idl = 0LL;
}
Div = cpu_use + cpu_sys + cpu_idl + cpu_iow + cpu_sto;