[BACK]Return to modstat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / modstat

Diff for /src/usr.bin/modstat/Attic/modstat.c between version 1.15 and 1.16

version 1.15, 2002/01/08 04:59:24 version 1.16, 2002/01/08 17:16:38
Line 58 
Line 58 
         "EXEC",          "EXEC",
         "MISC"          "MISC"
 };  };
   static int devfd;
   
 static void  static void
 usage()  usage()
Line 98 
Line 99 
         }          }
   
         /* Decode this stat buffer... */          /* Decode this stat buffer... */
         printf("%-7s %3d %3ld %0*lx %04lx %0*x %3ld %s\n",          printf("%-7s %3d %3ld %0*lx %04lx %0*lx %3ld %s\n",
             type_names[sbuf.type], sbuf.id, sbuf.offset, POINTERSIZE,              type_names[sbuf.type], sbuf.id, sbuf.offset, POINTERSIZE,
             (long)sbuf.area, (long)sbuf.size, POINTERSIZE,              (long)sbuf.area, (long)sbuf.size, POINTERSIZE,
             (long)sbuf.private, (long)sbuf.ver, sbuf.name);              (long)sbuf.private, (long)sbuf.ver, sbuf.name);
Line 106 
Line 107 
         return 0;          return 0;
 }  }
   
 int devfd;  
   
 int  int
 main(argc, argv)  main(argc, argv)
         int argc;          int argc;
Line 115 
Line 114 
 {  {
         int c, modnum = -1;          int c, modnum = -1;
         char *modname = NULL;          char *modname = NULL;
           char *endptr;
   
         while ((c = getopt(argc, argv, "i:n:")) != -1) {          while ((c = getopt(argc, argv, "i:n:")) != -1) {
                 switch (c) {                  switch (c) {
                 case 'i':                  case 'i':
                           modnum = (int)strtol(optarg, &endptr, 0);
                           if (modnum < 0 || modnum > INT_MAX || *endptr != '\0')
                                   errx(1, "%s: not a valid number", optarg);
                         modnum = atoi(optarg);                          modnum = atoi(optarg);
                         break;  /* number */                          break;
                 case 'n':                  case 'n':
                         modname = optarg;                          modname = optarg;
                         break;  /* name */                          break;
                 default:                  default:
                         usage();                          usage();
                         break;                          break;

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16