From 60b0ad039aa6aafc41f1c03df5d7fb01c709c723 Mon Sep 17 00:00:00 2001 From: jilles Date: Mon, 8 Oct 2012 16:00:33 +0000 Subject: [PATCH] MFC r240973: 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). git-svn-id: svn://svn.freebsd.org/base/stable/8@241352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/find/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c index 8e2b42cd2..b268d0d69 100644 --- a/usr.bin/find/main.c +++ b/usr.bin/find/main.c @@ -154,7 +154,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)); -- 2.45.0