--- projects/libstatgrab/src/statgrab/statgrab.c 2003/10/18 16:12:03 1.10 +++ projects/libstatgrab/src/statgrab/statgrab.c 2003/11/10 23:35:43 1.13 @@ -279,6 +279,8 @@ void populate_fs() { die("out of memory"); name = buf; + if (strlen(name) == 2 && name[1] == ':') + name[1] = '\0'; if (strncmp(name, "/dev/", 5) == 0) name += 5; while ((p = strchr(name, '/')) != NULL) @@ -369,7 +371,7 @@ void populate_page() { if (page != NULL) { add_stat(LONG_LONG, &page->pages_pagein, "page", "in", NULL); add_stat(LONG_LONG, &page->pages_pageout, "page", "out", NULL); - add_stat(LONG_LONG, &page->systime, "page", "systime", NULL); + add_stat(TIME_T, &page->systime, "page", "systime", NULL); } } @@ -602,6 +604,14 @@ int main(int argc, char **argv) { use_diffs = 1; select_interesting(argc - optind, &argv[optind]); + + /* We don't care if statgrab_init fails, because we can just display + the statistics that can be read as non-root. */ + statgrab_init(); +#ifdef ALLBSD + if (setegid(getgid()) != 0) + die("Failed to lose effective group"); +#endif switch (repeat_mode) { case REPEAT_NONE: