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); |
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); |
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': |
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); |
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(); |