Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Sep 2012 20:16:15 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240973 - head/usr.bin/find
Message-ID:  <201209262016.q8QKGFAF085865@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Wed Sep 26 20:16:15 2012
New Revision: 240973
URL: http://svn.freebsd.org/changeset/base/240973

Log:
  find: Do not pass fd to save current directory to child processes.
  
  This removes one of the two wrongly passed file descriptors. The other one
  appears to be from fts(3).
  
  MFC after:	1 week

Modified:
  head/usr.bin/find/main.c

Modified: head/usr.bin/find/main.c
==============================================================================
--- head/usr.bin/find/main.c	Wed Sep 26 20:14:04 2012	(r240972)
+++ head/usr.bin/find/main.c	Wed Sep 26 20:16:15 2012	(r240973)
@@ -151,7 +151,7 @@ main(int argc, char *argv[])
 		usage();
 	*p = NULL;
 
-	if ((dotfd = open(".", O_RDONLY, 0)) < 0)
+	if ((dotfd = open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
 		err(1, ".");
 
 	exit(find_execute(find_formplan(argv), start));



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