ps thread support

This commit is contained in:
albert
2003-09-20 08:29:55 +00:00
parent 4456afd68a
commit c462dcfad5
16 changed files with 295 additions and 86 deletions

4
w.c
View File

@ -146,7 +146,7 @@ static const proc_t *getproc(const utmp_t *restrict const u, const char *restric
*found_utpid = 0;
for(; *pptr; pptr++) {
const proc_t *restrict const tmp = *pptr;
if(unlikely(tmp->pid == u->ut_pid)) {
if(unlikely(tmp->tgid == u->ut_pid)) {
*found_utpid = 1;
best = tmp;
}
@ -158,7 +158,7 @@ static const proc_t *getproc(const utmp_t *restrict const u, const char *restric
secondbest = tmp;
}
if(!ignoreuser && uid != tmp->euid && uid != tmp->ruid) continue;
if(tmp->pid != tmp->tpgid) continue;
if(tmp->tgid != tmp->tpgid) continue;
if(best && tmp->start_time <= best->start_time) continue;
best = tmp;
}