Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jun 2014 05:51:45 +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: r268002 - head/sys/kern
Message-ID:  <201406280551.s5S5pjAr054546@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Sat Jun 28 05:51:45 2014
New Revision: 268002
URL: http://svnweb.freebsd.org/changeset/base/268002

Log:
  Call fdcloseexec right after fdunshare.
  
  No functional changes.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Sat Jun 28 05:41:53 2014	(r268001)
+++ head/sys/kern/kern_exec.c	Sat Jun 28 05:51:45 2014	(r268002)
@@ -595,6 +595,8 @@ interpret:
 	 * be shared after an exec.
 	 */
 	fdunshare(td);
+	/* close files on exec */
+	fdcloseexec(td);
 
 	/*
 	 * Malloc things before we need locks.
@@ -608,8 +610,6 @@ interpret:
 		bcopy(imgp->args->begin_argv, newargs->ar_args, i);
 	}
 
-	/* close files on exec */
-	fdcloseexec(td);
 	vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 
 	/* Get a reference to the vnode prior to locking the proc */



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