aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/find
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2012-09-26 20:16:15 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2012-09-26 20:16:15 +0000
commitbedab466ce221490b7f1d2bb85f7e6c194adc9c2 (patch)
tree34ef27283c0670dfc3b8ad89fab49306fbdc6e76 /usr.bin/find
parent80cd7c75965c54a5b1c9fdad6155529951deddf2 (diff)
downloadsrc-bedab466ce221490b7f1d2bb85f7e6c194adc9c2.tar.gz
src-bedab466ce221490b7f1d2bb85f7e6c194adc9c2.zip
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
Notes
Notes: svn path=/head/; revision=240973
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index b18255773f0b..628441332abd 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -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));