Make w make better guesses for user process

Based on suggestion by Herbert Xu <herbert@gondor.apana.org.au>
Bug-Debian: http://bugs.debian.org/187808
Author: Craig Small <csmall@debian.org>
This commit is contained in:
Jan Görig 2010-12-16 10:15:35 +01:00
parent 5f570a84f1
commit 63b6a8fcbf

2
w.c
View File

@ -159,7 +159,7 @@ static const proc_t *getproc(const utmp_t *restrict const u, const char *restric
secondbest = tmp; secondbest = tmp;
} }
if(!ignoreuser && uid != tmp->euid && uid != tmp->ruid) continue; if(!ignoreuser && uid != tmp->euid && uid != tmp->ruid) continue;
if(tmp->tgid != tmp->tpgid) continue; if(tmp->pgrp != tmp->tpgid) continue;
if(best && tmp->start_time <= best->start_time) continue; if(best && tmp->start_time <= best->start_time) continue;
best = tmp; best = tmp;
} }