From 695ea13d191c903b86b0d5795a2686a8c6e18015 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 11 Feb 2022 12:16:52 -0500 Subject: exec: Flush I/O streams before executing anything Otherwise output from commands may appear unexpectedly earlier than output from bfs. We use fflush(NULL) to flush all streams, which is more than GNU find does, but seems to be a useful extension. --- tests/test_exec_flush.out | 19 +++++++++++++++++++ tests/test_exec_flush_fprint.out | 1 + tests/test_exec_plus_flush.out | 1 + 3 files changed, 21 insertions(+) create mode 100644 tests/test_exec_flush.out create mode 100644 tests/test_exec_flush_fprint.out create mode 100644 tests/test_exec_plus_flush.out (limited to 'tests') diff --git a/tests/test_exec_flush.out b/tests/test_exec_flush.out new file mode 100644 index 0000000..0e6234a --- /dev/null +++ b/tests/test_exec_flush.out @@ -0,0 +1,19 @@ +basic found +basic/a found +basic/b found +basic/c found +basic/e found +basic/g found +basic/i found +basic/j found +basic/k found +basic/l found +basic/c/d found +basic/e/f found +basic/g/h found +basic/j/foo found +basic/k/foo found +basic/l/foo found +basic/k/foo/bar found +basic/l/foo/bar found +basic/l/foo/bar/baz found diff --git a/tests/test_exec_flush_fprint.out b/tests/test_exec_flush_fprint.out new file mode 100644 index 0000000..511198f --- /dev/null +++ b/tests/test_exec_flush_fprint.out @@ -0,0 +1 @@ +basic/a diff --git a/tests/test_exec_plus_flush.out b/tests/test_exec_plus_flush.out new file mode 100644 index 0000000..7c587ba --- /dev/null +++ b/tests/test_exec_plus_flush.out @@ -0,0 +1 @@ +basic/a found basic/a -- cgit v1.2.3