--- projects/libstatgrab/src/saidar/saidar.c 2003/10/18 14:08:36 1.8 +++ projects/libstatgrab/src/saidar/saidar.c 2003/10/20 15:25:48 1.10 @@ -335,7 +335,7 @@ void display_data(){ move(13+stats.network_entries+counter, 62); printw("%7s", size_conv(disk_stat_ptr->avail)); move(13+stats.network_entries+counter, 73); - printw("%5.2f%%", 100.00 * ((float) (disk_stat_ptr->size - disk_stat_ptr->avail) / (float) disk_stat_ptr->size)); + printw("%5.2f%%", 100.00 * ((float) disk_stat_ptr->used / (float) (disk_stat_ptr->used + disk_stat_ptr->avail))); disk_stat_ptr++; } @@ -397,7 +397,20 @@ int main(int argc, char **argv){ char ch; int delay=2; - +#ifdef ALLBSD + gid_t gid; +#endif + if(statgrab_init() != 0){ + fprintf(stderr, "statgrab_init failed. Please check the permissions\n"); + return 1; + } +#ifdef ALLBSD + if((setegid(getgid())) != 0){ + fprintf(stderr, "Failed to lose setgid'ness\n"); + return 1; + } +#endif + while ((c = getopt(argc, argv, "vhd:")) != EOF){ switch (c){ case 'd':