diff --git a/main.c b/main.c index 7a00f8a..1ea3aa6 100644 --- a/main.c +++ b/main.c @@ -90,19 +90,19 @@ int main(int argc, char* argv[]) { } unsigned long drbytes = 0; - if(history[i][1] > 0) { - drbytes = rbytes - history[i][1]; + if(history[i][0] > 0) { + drbytes = rbytes - (history[i][0] * bsize); } unsigned long dwblbks = 0; - if (history[i][2] > 0) { - dwblbks = wblks - history[i][2]; + if (history[i][1] > 0) { + dwblbks = wblks - history[i][1]; } unsigned long dwbytes = 0; - if(history[i][3] > 0) { - dwbytes = wbytes - history[i][3]; + if(history[i][1] > 0) { + dwbytes = wbytes - (history[i][1] * bsize); } @@ -119,9 +119,7 @@ int main(int argc, char* argv[]) { dwbytes); history[i][0] = rblks; - history[i][1] = rbytes; - history[i][2] = wblks; - history[i][3] = wbytes; + history[i][1] = wblks; } sleep(10);