From bedab466ce221490b7f1d2bb85f7e6c194adc9c2 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 26 Sep 2012 20:16:15 +0000 Subject: [PATCH] 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 --- 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 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));