Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2015 09:08:31 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284442 - head/sys/kern
Message-ID:  <201506160908.t5G98Vxk041410@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506160908.t5G98Vxk041410>