From 6eec064597c2f440c51146cac85dc2326a0e0cda Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Fri, 20 May 2011 01:26:41 +0100 Subject: split: exit when we can no longer write to a --filter * src/split.c (bytes_split): Stop reading when we can no longer write to a child process. (lines_rr): Likewise. (lines_bytes_split): No change is made here since input is bounded by the original file size. * test/split/filter: Add test cases. --- tests/split/filter | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/split/filter b/tests/split/filter index 0614841ed..a42c5539e 100755 --- a/tests/split/filter +++ b/tests/split/filter @@ -47,4 +47,8 @@ stat x?? 2>/dev/null && fail=1 # where they would result in a non zero exit from split. yes | head -n200K | split -b1G --filter='head -c1 >/dev/null' || fail=1 +# Ensure that endless input is ignored when all filters finish +timeout 10 yes | split --filter="head -c1 >/dev/null" -n r/1 || fail=1 +timeout 10 split --filter="head -c1 >/dev/null" -n 1 /dev/zero || fail=1 + Exit $fail -- cgit v1.2.3-70-g09d2