OpenBSD: Always update username

This commit is contained in:
Benny Baumann 2021-06-18 20:42:25 +02:00 committed by BenBE
parent 6a6b09b431
commit d2a476cddb
1 changed files with 5 additions and 2 deletions

View File

@ -284,10 +284,8 @@ static void OpenBSDProcessList_scanProcs(OpenBSDProcessList* this) {
proc->pgrp = kproc->p__pgid; proc->pgrp = kproc->p__pgid;
proc->isKernelThread = proc->pgrp == 0; proc->isKernelThread = proc->pgrp == 0;
proc->isUserlandThread = kproc->p_tid != -1; proc->isUserlandThread = kproc->p_tid != -1;
proc->st_uid = kproc->p_uid;
proc->starttime_ctime = kproc->p_ustart_sec; proc->starttime_ctime = kproc->p_ustart_sec;
Process_fillStarttimeBuffer(proc); Process_fillStarttimeBuffer(proc);
proc->user = UsersTable_getRef(this->super.usersTable, proc->st_uid);
ProcessList_add(&this->super, proc); ProcessList_add(&this->super, proc);
OpenBSDProcessList_updateProcessName(this->kd, kproc, proc); OpenBSDProcessList_updateProcessName(this->kd, kproc, proc);
@ -323,6 +321,11 @@ static void OpenBSDProcessList_scanProcs(OpenBSDProcessList* this) {
proc->majflt = kproc->p_uru_majflt; proc->majflt = kproc->p_uru_majflt;
proc->nlwp = 1; proc->nlwp = 1;
if (proc->st_uid != kproc->p_uid) {
proc->st_uid = kproc->p_uid;
proc->user = UsersTable_getRef(this->super.usersTable, proc->st_uid);
}
switch (kproc->p_stat) { switch (kproc->p_stat) {
case SIDL: proc->state = 'I'; break; case SIDL: proc->state = 'I'; break;
case SRUN: proc->state = 'P'; break; case SRUN: proc->state = 'P'; break;