diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-05-20 01:26:41 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-05-26 00:12:05 +0100 |
commit | 6eec064597c2f440c51146cac85dc2326a0e0cda (patch) | |
tree | 936a674ace7b410ae287fa8bb709b46ca39b539f /tests | |
parent | 5908e29e825286121c69f5c10c313ccae6860fa7 (diff) | |
download | coreutils-6eec064597c2f440c51146cac85dc2326a0e0cda.tar.xz |
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.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/split/filter | 4 |
1 files changed, 4 insertions, 0 deletions
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 |