diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-03-12 14:28:34 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-03-12 14:28:34 +0000 |
commit | d079d0a0d2a3fc602454f71be5c06edf2ba1586a (patch) | |
tree | a69c1ffd9aeb5bba25be3ec7e52e3c9a54c0b978 /sys/kern | |
parent | 59f21d5ab15894ed8a37b953765c081c6f223582 (diff) | |
download | src-d079d0a0d2a3fc602454f71be5c06edf2ba1586a.tar.gz src-d079d0a0d2a3fc602454f71be5c06edf2ba1586a.zip |
Clean up a bit.
Reviewed by: rwatson
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=143466
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_proc.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 8f738ba76c43..d0d42547afd7 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -612,6 +612,7 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) struct tty *tp; struct session *sp; struct timeval tv; + struct ucred *cred; struct sigacts *ps; p = td->td_proc; @@ -632,19 +633,20 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) #endif kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; - if (p->p_ucred) { - kp->ki_uid = p->p_ucred->cr_uid; - kp->ki_ruid = p->p_ucred->cr_ruid; - kp->ki_svuid = p->p_ucred->cr_svuid; + cred = p->p_ucred; + if (cred) { + kp->ki_uid = cred->cr_uid; + kp->ki_ruid = cred->cr_ruid; + kp->ki_svuid = cred->cr_svuid; /* XXX bde doesn't like KI_NGROUPS */ - kp->ki_ngroups = min(p->p_ucred->cr_ngroups, KI_NGROUPS); - bcopy(p->p_ucred->cr_groups, kp->ki_groups, + kp->ki_ngroups = min(cred->cr_ngroups, KI_NGROUPS); + bcopy(cred->cr_groups, kp->ki_groups, kp->ki_ngroups * sizeof(gid_t)); - kp->ki_rgid = p->p_ucred->cr_rgid; - kp->ki_svgid = p->p_ucred->cr_svgid; + kp->ki_rgid = cred->cr_rgid; + kp->ki_svgid = cred->cr_svgid; } - if (p->p_sigacts) { - ps = p->p_sigacts; + ps = p->p_sigacts; + if (ps) { mtx_lock(&ps->ps_mtx); kp->ki_sigignore = ps->ps_sigignore; kp->ki_sigcatch = ps->ps_sigcatch; @@ -752,7 +754,6 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) kp->ki_childtime = kp->ki_childstime; timevaladd(&kp->ki_childtime, &kp->ki_childutime); } - sp = NULL; tp = NULL; if (p->p_pgrp) { kp->ki_pgid = p->p_pgrp->pg_id; |