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
This commit is contained in:
Jilles Tjoelker 2012-09-26 20:16:15 +00:00
parent 80cd7c7596
commit bedab466ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240973

View File

@ -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));