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

Diff for /src/usr.bin/fstat/fstat.c between version 1.23 and 1.24

version 1.23, 1999/07/01 21:41:58 version 1.24, 1999/07/02 19:23:50
Line 96 
Line 96 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   #include <netdb.h>
 #include <err.h>  #include <err.h>
 #include "fstat.h"  #include "fstat.h"
   
Line 904 
Line 905 
 getinetproto(number)  getinetproto(number)
         int number;          int number;
 {  {
         char *cp;          static int isopen;
           register struct protoent *pe;
   
         switch(number) {          if (!isopen)
         case IPPROTO_IP:                  setprotoent(++isopen);
                 cp = "ip"; break;          if ((pe = getprotobynumber(number)) != NULL)
         case IPPROTO_ICMP:                  printf(" %s", pe->p_name);
                 cp ="icmp"; break;          else
         case IPPROTO_GGP:  
                 cp ="ggp"; break;  
         case IPPROTO_TCP:  
                 cp ="tcp"; break;  
         case IPPROTO_EGP:  
                 cp ="egp"; break;  
         case IPPROTO_PUP:  
                 cp ="pup"; break;  
         case IPPROTO_UDP:  
                 cp ="udp"; break;  
         case IPPROTO_IDP:  
                 cp ="idp"; break;  
         case IPPROTO_RAW:  
                 cp ="raw"; break;  
         default:  
                 printf(" %d", number);                  printf(" %d", number);
                 return;  
         }  
         printf(" %s", cp);  
 }  }
   
 int  int

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24