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

Diff for /src/usr.bin/netstat/if.c between version 1.61 and 1.62

version 1.61, 2009/08/04 03:45:47 version 1.62, 2009/11/22 22:22:14
Line 56 
Line 56 
 #include "netstat.h"  #include "netstat.h"
   
 static void print_addr(struct sockaddr *, struct sockaddr **, struct if_data *);  static void print_addr(struct sockaddr *, struct sockaddr **, struct if_data *);
 static void sidewaysintpr(u_int);  static void sidewaysintpr(u_int, int);
 static void catchalarm(int);  static void catchalarm(int);
 static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **);  static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **);
 static void fetchifs(void);  static void fetchifs(void);
Line 67 
Line 67 
  * which is a TAILQ_HEAD.   * which is a TAILQ_HEAD.
  */   */
 void  void
 intpr(int interval)  intpr(int interval, int repeatcount)
 {  {
         struct if_msghdr ifm;          struct if_msghdr ifm;
         int mib[6] = { CTL_NET, AF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };          int mib[6] = { CTL_NET, AF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
Line 82 
Line 82 
         size_t len;          size_t len;
   
         if (interval) {          if (interval) {
                 sidewaysintpr((unsigned)interval);                  sidewaysintpr((unsigned)interval, repeatcount);
                 return;                  return;
         }          }
   
Line 350 
Line 350 
  * First line printed at top of screen is always cumulative.   * First line printed at top of screen is always cumulative.
  */   */
 static void  static void
 sidewaysintpr(unsigned int interval)  sidewaysintpr(unsigned int interval, int repeatcount)
 {  {
         sigset_t emptyset;          sigset_t emptyset;
         int line;          int line;
Line 449 
Line 449 
   
         putchar('\n');          putchar('\n');
         fflush(stdout);          fflush(stdout);
           if (repeatcount && --repeatcount == 0)
                   return;
         line++;          line++;
         sigemptyset(&emptyset);          sigemptyset(&emptyset);
         if (!signalled)          if (!signalled)
                 sigsuspend(&emptyset);                  sigsuspend(&emptyset);
         signalled = 0;          signalled = 0;
         (void)alarm(interval);          (void)alarm(interval);
         if (line == 21)          if (line == 21 && isatty(STDOUT_FILENO))
                 goto banner;                  goto banner;
         goto loop;          goto loop;
         /*NOTREACHED*/  
 }  }
   
 /*  /*

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.62