/[machmon]/machmon/linux/source/machmon.c
ViewVC logotype

Diff of /machmon/linux/source/machmon.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pbastos, Tue Jul 9 12:38:59 2002 UTC revision 1.6 by clorets, Mon Jul 15 20:41:36 2002 UTC
# Line 123  sync_run(volatile sig_atomic_t sigval) Line 123  sync_run(volatile sig_atomic_t sigval)
123                          (void) wnoutrefresh(twin);                          (void) wnoutrefresh(twin);
124                  }                  }
125    
         output("\n~wPress ~R'i'~w to show network statistics or ~R'q'~w to quit.");  
   
126          (void) move(0, 0);          (void) move(0, 0);
127          (void) doupdate();          (void) doupdate();
128          (void) untouchwin(twin);          (void) untouchwin(twin);
# Line 176  timer_setup(int secs) Line 174  timer_setup(int secs)
174    
175          ival.it_value.tv_sec = 0;          ival.it_value.tv_sec = 0;
176          ival.it_value.tv_usec = 1;          ival.it_value.tv_usec = 1;
177          ival.it_interval.tv_sec = 10;          ival.it_interval.tv_sec = synctime;
178          ival.it_interval.tv_usec = 0;          ival.it_interval.tv_usec = 0;
179            if (setitimer(ITIMER_REAL, &ival, NULL) == 0)
         if (setitimer(ITIMER_REAL, &ival, NULL) == 0)  
180                  return (1);                  return (1);
181    
182          return (0);          return (0);
# Line 217  main(int argc, char **argv) Line 214  main(int argc, char **argv)
214  {  {
215          int ch;          int ch;
216    
         synctime = 10;  
217          while ((ch = getopt(argc, argv, "dht:u:c:")) != -1) {          while ((ch = getopt(argc, argv, "dht:u:c:")) != -1) {
218                  switch (ch) {                  switch (ch) {
219                  case 'd':                  case 'd':
# Line 227  main(int argc, char **argv) Line 223  main(int argc, char **argv)
223                          usage();                          usage();
224                          /* NOTREACHED */                          /* NOTREACHED */
225                  case 't':                  case 't':
226                          if (xatoi(optarg, &synctime) == -1)                          if (xatoi(optarg, &synctime) == -1){
227                                  errx(1, "-t: %s: not a number", optarg);                                  errx(1, "-t: %s: not a number", optarg);}
228                            else{
229                            synctime = atoi(optarg);}
230                            
231                          break;                          break;
232                  case 'c':                  case 'c':
233                          POINTER_FILL(file, 2 * MAXPATHLEN);                          POINTER_FILL(file, 2 * MAXPATHLEN);
# Line 265  main(int argc, char **argv) Line 264  main(int argc, char **argv)
264                  warnx("could not initialize display");                  warnx("could not initialize display");
265                  exit(0);                  exit(0);
266          }          }
267            d_htnm();
268    
269          d_htnm();           if (!timer_setup(synctime)) /* set up alarm clock */
   
         if (!timer_setup(synctime)) /* set up alarm clock */  
270                  err(1, "setup_timer");                  err(1, "setup_timer");
271    
272          internal_loop();          internal_loop();

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

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26