libproc buffer extension, better w guess

This commit is contained in:
csmall committed 2002-05-15 12:54:32 +00:00
1 parent 264c563f54
commit 4a21f35257
3 files changed
+12 -2

No files matched your search

+4 -1
View File
@@ -146,7 +146,10 @@ static proc_t *getproc(utmp_t *u, char *tty, int *jcpu, int *found_utpid) {
line = tty_to_dev(tty);
*jcpu = *found_utpid = 0;
for(p = procs; *p; p++) {
if((**p).pid == u->ut_pid) *found_utpid = 1;
if((**p).pid == u->ut_pid) {
*found_utpid = 1;
best = *p;
}
if((**p).tty != line) continue;
(*jcpu) += (**p).utime + (**p).stime;
secondbest = *p;