[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.5 and 1.6

version 1.5, 1996/08/05 11:11:41 version 1.6, 1996/08/06 18:17:22
Line 1 
Line 1 
 /* *    $OpenBSD$*/  /*      $OpenBSD$       */
   
 /*  /*
  * Copyright (c) 1993 Terrence R. Lambert.   * Copyright (c) 1993 Terrence R. Lambert.
  * All rights reserved.   * All rights reserved.
Line 51 
Line 52 
 {  {
   
         fprintf(stderr,          fprintf(stderr,
             "usage: modstat [-i <module id>] [-n <module name>]\n");              "usage: modstat [-i moduleid] [-n modulename]\n");
         exit(1);          exit(1);
 }  }
   
Line 76 
Line 77 
         sbuf.id = modnum;          sbuf.id = modnum;
         sbuf.name = name;          sbuf.name = name;
   
         if (modname != NULL)          if (modname != NULL) {
                   if (strlen(modname) >= sizeof(sbuf.name))
                           return 4;
                 strcpy(sbuf.name, modname);                  strcpy(sbuf.name, modname);
           }
   
         if (ioctl(devfd, LMSTAT, &sbuf) == -1) {          if (ioctl(devfd, LMSTAT, &sbuf) == -1) {
                 switch (errno) {                  switch (errno) {
Line 137 
Line 141 
                 case 'n':                  case 'n':
                         modname = optarg;                          modname = optarg;
                         break;  /* name */                          break;  /* name */
                 case '?':  
                         usage();  
                 default:                  default:
                         printf("default!\n");                          usage();
                         break;                          break;
                 }                  }
         }          }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6