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

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

version 1.23, 2002/02/19 19:39:39 version 1.24, 2002/06/18 00:46:37
Line 86 
Line 86 
 static void usage(void);  static void usage(void);
   
 int  int
 main(argc, argv)  main(int argc, char *argv[])
         int argc;  
         char **argv;  
 {  {
         int ch;          int ch;
         char errbuf[_POSIX2_LINE_MAX];          char errbuf[_POSIX2_LINE_MAX];
   
         while ((ch = getopt(argc, argv, "w:")) != -1)          while ((ch = getopt(argc, argv, "w:")) != -1)
                 switch(ch) {                  switch (ch) {
                 case 'w':                  case 'w':
                         if ((naptime = atoi(optarg)) <= 0)                          if ((naptime = atoi(optarg)) <= 0)
                                 errx(1, "interval <= 0.");                                  errx(1, "interval <= 0.");
Line 129 
Line 127 
                 exit(1);                  exit(1);
         }          }
   
           setegid(getgid());
           setgid(getgid());
   
         signal(SIGINT, sigdie);          signal(SIGINT, sigdie);
         siginterrupt(SIGINT, 1);          siginterrupt(SIGINT, 1);
         signal(SIGQUIT, sigdie);          signal(SIGQUIT, sigdie);
Line 142 
Line 143 
          * an overlapping sub-window of stdscr configured by the display           * an overlapping sub-window of stdscr configured by the display
          * routines to minimize update work by curses.           * routines to minimize update work by curses.
          */           */
         if (initscr() == NULL)          if (initscr() == NULL) {
         {  
                 warnx("couldn't initialize screen");                  warnx("couldn't initialize screen");
                 exit(0);                  exit(0);
         }          }
Line 179 
Line 179 
 }  }
   
 void  void
 gethz()  gethz(void)
 {  {
         struct clockinfo cinf;          struct clockinfo cinf;
         size_t  size = sizeof(cinf);          size_t  size = sizeof(cinf);
Line 194 
Line 194 
 }  }
   
 static void  static void
 usage()  usage(void)
 {  {
         fprintf(stderr, "usage: systat [-M core] [-N system] [-w wait]\n");          fprintf(stderr, "usage: systat [-M core] [-N system] [-w wait]\n");
         fprintf(stderr,          fprintf(stderr,
Line 204 
Line 204 
   
   
 void  void
 labels()  labels(void)
 {  {
         if (curcmd->c_flags & CF_LOADAV) {          if (curcmd->c_flags & CF_LOADAV) {
                 mvaddstr(2, 20,                  mvaddstr(2, 20,
Line 262 
Line 262 
 }  }
   
 void  void
 load()  load(void)
 {  {
   
         (void) getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0]));          (void) getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0]));
Line 283 
Line 283 
 }  }
   
 void  void
 die()  die(void)
 {  {
         if (wnd) {          if (wnd) {
                 move(CMDLINE, 0);                  move(CMDLINE, 0);
Line 295 
Line 295 
 }  }
   
 void  void
 sigwinch(signo)  sigwinch(int signo)
         int signo;  
 {  {
         gotwinch = 1;          gotwinch = 1;
 }  }
Line 326 
Line 325 
 }  }
   
 void  void
 nlisterr(namelist)  nlisterr(struct nlist namelist[])
         struct nlist namelist[];  
 {  {
         int i, n;          int i, n;
   

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