|
Lines 99-105
Link Here
|
| 99 |
|
99 |
|
| 100 |
void updatestat(); |
100 |
void updatestat(); |
| 101 |
static stat_is_init = 0; |
101 |
static stat_is_init = 0; |
| 102 |
static kvm_t *kd; |
102 |
static kvm_t *kd = NULL; |
| 103 |
|
103 |
|
| 104 |
static int cp_time_xlat[RSTAT_CPUSTATES] = { CP_USER, CP_NICE, CP_SYS, |
104 |
static int cp_time_xlat[RSTAT_CPUSTATES] = { CP_USER, CP_NICE, CP_SYS, |
| 105 |
CP_IDLE }; |
105 |
CP_IDLE }; |
|
Lines 203-217
Link Here
|
| 203 |
#ifdef DEBUG |
203 |
#ifdef DEBUG |
| 204 |
fprintf(stderr, "about to closedown\n"); |
204 |
fprintf(stderr, "about to closedown\n"); |
| 205 |
#endif |
205 |
#endif |
| 206 |
if (from_inetd) |
206 |
if (from_inetd) { |
|
|
207 |
kvm_close(kd); |
| 207 |
exit(0); |
208 |
exit(0); |
|
|
209 |
} |
| 208 |
else { |
210 |
else { |
| 209 |
stat_is_init = 0; |
211 |
stat_is_init = 0; |
| 210 |
return; |
212 |
return; |
| 211 |
} |
213 |
} |
| 212 |
} |
214 |
} |
|
|
215 |
|
| 216 |
alarm(0); |
| 213 |
sincelastreq++; |
217 |
sincelastreq++; |
| 214 |
|
218 |
|
|
|
219 |
|
| 215 |
mib[0] = CTL_KERN; |
220 |
mib[0] = CTL_KERN; |
| 216 |
mib[1] = KERN_CLOCKRATE; |
221 |
mib[1] = KERN_CLOCKRATE; |
| 217 |
len = sizeof clockrate; |
222 |
len = sizeof clockrate; |
|
Lines 315-321
Link Here
|
| 315 |
|
320 |
|
| 316 |
int en; |
321 |
int en; |
| 317 |
|
322 |
|
| 318 |
if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) == NULL) { |
323 |
|
|
|
324 |
if (kd == NULL && |
| 325 |
(kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) == NULL) { |
| 319 |
syslog(LOG_ERR, "rpc.rstatd, %s", errbuf); |
326 |
syslog(LOG_ERR, "rpc.rstatd, %s", errbuf); |
| 320 |
exit(1); |
327 |
exit(1); |
| 321 |
} |
328 |
} |