fd: don't unnecessary copy capabilities in _fget
This commit is contained in:
parent
9c5682ed70
commit
80f3623f2f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=284442
@ -2433,11 +2433,9 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags,
|
||||
|
||||
*fpp = NULL;
|
||||
fdp = td->td_proc->p_fd;
|
||||
if (needrightsp != NULL)
|
||||
needrights = *needrightsp;
|
||||
else
|
||||
cap_rights_init(&needrights);
|
||||
error = fget_unlocked(fdp, fd, &needrights, &fp, seqp);
|
||||
if (needrightsp == NULL)
|
||||
needrightsp = cap_rights_init(&needrights);
|
||||
error = fget_unlocked(fdp, fd, needrightsp, &fp, seqp);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (fp->f_ops == &badfileops) {
|
||||
|
Loading…
Reference in New Issue
Block a user