diff options
author | Pádraig Brady <P@draigBrady.com> | 2015-06-30 06:58:57 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2015-07-01 12:27:29 +0100 |
commit | f2db30e676c2f124a318b2313946b450fb9de79f (patch) | |
tree | 7f60e8864af844e2181d08ad96286d9e035c6ad9 /init.cfg | |
parent | e1358a7dd9817fd36166aaaa06cb10cfdd4c3ea7 (diff) | |
download | coreutils-f2db30e676c2f124a318b2313946b450fb9de79f.tar.xz |
factor: ensure atomic output through pipes
The new tests/misc/factor-parallel.sh test was
seen to fail on FreeBSD (derived) systems, which was
due to split(1) --filter reading partial lines
through pipes, as factor(1) was writing a little
over PIPE_BUF each time.
* src/factor.c (lbuf): A new structure to internally buffer lines.
(lbuf_alloc): A new function to allocate enough at program start.
(lbuf_putint): A new function to buffer a uintmax_t.
(lbuf_flush): A new function to write directly to standard output.
(lbuf_putc): A new function to buffer a character and if enough
lines are buffered, then output complete lines <= PIPE_BUF,
and continue to buffer the rest.
(main): Call the internal buffer allocator, and register
the final flush from the internal buffer at program exit.
Diffstat (limited to 'init.cfg')
0 files changed, 0 insertions, 0 deletions