From owner-svn-src-all@FreeBSD.ORG Sun Jul 6 23:23:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A8EB764; Sun, 6 Jul 2014 23:23:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D5502FD3; Sun, 6 Jul 2014 23:23:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66NN2Jr087255; Sun, 6 Jul 2014 23:23:02 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66NN2JX087250; Sun, 6 Jul 2014 23:23:02 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062323.s66NN2JX087250@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 23:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268345 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:23:03 -0000 Author: mjg Date: Sun Jul 6 23:23:01 2014 New Revision: 268345 URL: http://svnweb.freebsd.org/changeset/base/268345 Log: MFC r268001: Make fdunshare accept only td parameter. Proc had to match the thread anyway and 2 parameters were inconsistent with the rest. Modified: stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_fork.c stable/10/sys/sys/filedesc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 23:23:01 2014 (r268345) @@ -1883,9 +1883,10 @@ fdshare(struct filedesc *fdp) * Unshare a filedesc structure, if necessary by making a copy */ void -fdunshare(struct proc *p, struct thread *td) +fdunshare(struct thread *td) { struct filedesc *tmp; + struct proc *p = td->td_proc; if (p->p_fd->fd_refcnt == 1) return; Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/kern/kern_exec.c Sun Jul 6 23:23:01 2014 (r268345) @@ -597,7 +597,7 @@ interpret: * For security and other reasons, the file descriptor table cannot * be shared after an exec. */ - fdunshare(p, td); + fdunshare(td); /* * Malloc things before we need locks. Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/kern/kern_fork.c Sun Jul 6 23:23:01 2014 (r268345) @@ -347,8 +347,8 @@ fork_norfproc(struct thread *td, int fla /* * Unshare file descriptors (from parent). */ - if (flags & RFFDG) - fdunshare(p1, td); + if (flags & RFFDG) + fdunshare(td); fail: if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && Modified: stable/10/sys/sys/filedesc.h ============================================================================== --- stable/10/sys/sys/filedesc.h Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/sys/filedesc.h Sun Jul 6 23:23:01 2014 (r268345) @@ -153,7 +153,7 @@ int fdcheckstd(struct thread *td); void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td); void fdcloseexec(struct thread *td); struct filedesc *fdcopy(struct filedesc *fdp); -void fdunshare(struct proc *p, struct thread *td); +void fdunshare(struct thread *td); void fdescfree(struct thread *td); struct filedesc *fdinit(struct filedesc *fdp); struct filedesc *fdshare(struct filedesc *fdp);