|
|
@ -507,15 +507,13 @@ void parse_file(pid_t pid) |
|
|
|
unsigned long cycles_hi, cycles_lo; |
|
|
|
FILE *fp; |
|
|
|
struct proc *p; |
|
|
|
int i; |
|
|
|
int slot; |
|
|
|
int i; |
|
|
|
|
|
|
|
sprintf(path, "/proc/%d/psinfo", pid); |
|
|
|
sprintf(path, "%d/psinfo", pid); |
|
|
|
|
|
|
|
if ((fp = fopen(path, "r")) == NULL) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (fscanf(fp, "%d", &version) != 1) |
|
|
|
{ |
|
|
@ -535,7 +533,6 @@ void parse_file(pid_t pid) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
slot++; |
|
|
|
slot = SLOT_NR(endpt); |
|
|
|
|
|
|
|
if (slot < 0 || slot >= nr_total) |
|
|
@ -561,6 +558,7 @@ void parse_file(pid_t pid) |
|
|
|
|
|
|
|
if (fscanf(fp, " %255s %c %d %d %lu %*u %lu %lu", name, &state, &p->p_blocked, &p->p_priority, &p->p_user_time, &cycles_hi, &cycles_lo) != 7) |
|
|
|
{ |
|
|
|
|
|
|
|
fclose(fp); |
|
|
|
return; |
|
|
|
} |
|
|
@ -580,6 +578,7 @@ void parse_file(pid_t pid) |
|
|
|
int j; |
|
|
|
if ((j = fscanf(fp, " %lu %*u %*u %*c %*d %*u %u %*u %d %*c %*d %*u", &p->p_memory, &effuid, &p->p_nice)) != 3) |
|
|
|
{ |
|
|
|
|
|
|
|
fclose(fp); |
|
|
|
return; |
|
|
|
} |
|
|
|