summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1995-09-12 23:15:33 +0000
committernate <nate@FreeBSD.org>1995-09-12 23:15:33 +0000
commitceb4b5097101339e2b70f809790947544f27ec45 (patch)
tree740f444185973f71e4299721fd204e3e1bdeea67 /usr.bin/find
parent05ba62283064c2394339fa3975fe9a4da67c12a9 (diff)
downloadFreeBSD-src-ceb4b5097101339e2b70f809790947544f27ec45.zip
FreeBSD-src-ceb4b5097101339e2b70f809790947544f27ec45.tar.gz
Simpler fix to the find bug reported by Terry Lambert <terry@lambert.org>
[ Find to a file vs. to stdout ] produces different output because find does not flush stdout when doing a -print. Submitted by: Jeffrey Hsu <hsu@freefall.freebsd.org>
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/function.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 6bd85b5..c316b9d 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -239,6 +239,9 @@ f_exec(plan, entry)
if (plan->flags == F_NEEDOK && !queryuser(plan->e_argv))
return (0);
+ /* make sure find output is interspersed correctly with subprocesses */
+ fflush(stdout);
+
switch (pid = vfork()) {
case -1:
err(1, "fork");
OpenPOWER on IntegriCloud