mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Use pget(9) to reduce code duplication.
MFC after: 1 week
This commit is contained in:
parent
fb5ea9d1c8
commit
c9d59a63e3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249240
@ -2944,12 +2944,9 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS)
|
||||
struct tty *tp;
|
||||
|
||||
name = (int *)arg1;
|
||||
if ((p = pfind((pid_t)name[0])) == NULL)
|
||||
return (ESRCH);
|
||||
if ((error = p_candebug(curthread, p))) {
|
||||
PROC_UNLOCK(p);
|
||||
error = pget((pid_t)name[0], PGET_CANDEBUG, &p);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
}
|
||||
fdp = fdhold(p);
|
||||
PROC_UNLOCK(p);
|
||||
if (fdp == NULL)
|
||||
@ -3239,12 +3236,9 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS)
|
||||
cap_rights_t fd_cap_rights;
|
||||
|
||||
name = (int *)arg1;
|
||||
if ((p = pfind((pid_t)name[0])) == NULL)
|
||||
return (ESRCH);
|
||||
if ((error = p_candebug(curthread, p))) {
|
||||
PROC_UNLOCK(p);
|
||||
error = pget((pid_t)name[0], PGET_CANDEBUG, &p);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
}
|
||||
/* ktrace vnode */
|
||||
tracevp = p->p_tracevp;
|
||||
if (tracevp != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user