Author: mjg Date: Tue Jun 16 09:08:30 2015 New Revision: 284442 URL: https://svnweb.freebsd.org/changeset/base/284442
Log: fd: don't unnecessary copy capabilities in _fget Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Jun 16 08:36:57 2015 (r284441) +++ head/sys/kern/kern_descrip.c Tue Jun 16 09:08:30 2015 (r284442) @@ -2433,11 +2433,9 @@ _fget(struct thread *td, int fd, struct *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) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"