--- projects/libstatgrab/src/statgrab/statgrab.c 2003/08/27 14:04:17 1.3 +++ projects/libstatgrab/src/statgrab/statgrab.c 2003/08/28 21:21:32 1.5 @@ -79,10 +79,7 @@ void clear_stats() { for (i = 0; i < num_stats; i++) free(stats[i].name); - free(stats); - stats = NULL; num_stats = 0; - alloc_stats = 0; } /* Add a stat. The varargs make up the name, joined with dots; the name is @@ -418,10 +415,11 @@ void usage() { " -s Display stat differences repeatedly\n" " -o Display stat differences once\n" " -t DELAY When repeating, wait DELAY seconds between updates (default 1)\n" - " -p Display CPU usage as percentages rather than absolute values\n" + " -p Display CPU usage differences as percentages rather than\n" + " absolute values\n" "\n"); printf("Version %s - report bugs to <%s>.\n", - PACKAGE_VERSION, PACKAGE_BUGREPORT); + PACKAGE_VERSION, PACKAGE_BUGREPORT); exit(1); } @@ -467,9 +465,12 @@ int main(int argc, char **argv) { if (display_mode == DISPLAY_MRTG) { if ((argc - optind) != 2) die("mrtg mode: must specify exactly two stats"); - if (repeat_mode != REPEAT_NONE) + if (repeat_mode == REPEAT_FOREVER) die("mrtg mode: cannot repeat display"); } + + if (use_cpu_percent && repeat_mode == REPEAT_NONE) + die("CPU percentage usage display requires stat differences"); switch (repeat_mode) { case REPEAT_NONE: