--- projects/libstatgrab/examples/vm_stats.c 2004/01/19 16:49:19 1.7 +++ projects/libstatgrab/examples/vm_stats.c 2004/04/04 22:48:49 1.8 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: vm_stats.c,v 1.7 2004/01/19 16:49:19 tdb Exp $ + * $Id: vm_stats.c,v 1.8 2004/04/04 22:48:49 tdb Exp $ */ #include @@ -27,24 +27,11 @@ int main(int argc, char **argv){ - extern char *optarg; - extern int optind; - int c; - - int delay = 1; mem_stat_t *mem_stats; swap_stat_t *swap_stats; long long total, free; - while ((c = getopt(argc, argv, "d:")) != -1){ - switch (c){ - case 'd': - delay = atoi(optarg); - break; - } - } - /* Initialise statgrab */ statgrab_init(); @@ -69,6 +56,10 @@ int main(int argc, char **argv){ printf("Total VM usage : %5.2f%%\n", 100 - (((float)total/(float)free))); + } + else { + printf("Unable to get VM stats.\n"); + exit(1); } exit(0); }