irrespective of which kernel version coreutils is built against,
reinstating that behaviour from coreutils-9.0.
+ od will now exit immediately upon receiving a write error, which is
+ significant when reading large / unbounded inputs.
+
split now uses more tuned access patterns for its potentially large input.
This was seen to improve throughput by 5% when reading from SSD.
if (limit_bytes_to_format)
{
- while (true)
+ while (ok)
{
size_t n_needed;
if (current_offset >= end_offset)
affirm (n_bytes_read == bytes_per_block);
write_block (current_offset, n_bytes_read,
block[!idx], block[idx]);
+ if (ferror (stdout))
+ ok = false;
current_offset += n_bytes_read;
idx = !idx;
}
}
else
{
- while (true)
+ while (ok)
{
ok &= read_block (bytes_per_block, block[idx], &n_bytes_read);
if (n_bytes_read < bytes_per_block)
affirm (n_bytes_read == bytes_per_block);
write_block (current_offset, n_bytes_read,
block[!idx], block[idx]);
+ if (ferror (stdout))
+ ok = false;
current_offset += n_bytes_read;
idx = !idx;
}