split: accept new output --filter=CMD option
authorKarl Heuer <kwzh@gnu.org>
Fri, 29 Apr 2011 10:23:27 +0000 (12:23 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 6 May 2011 20:54:51 +0000 (22:54 +0200)
commita09d9e5badacd08058a23dea97bec4e93c0e689a
tree1dad9de2679d6488086e6b1ba9997413c02ac430
parenta1f21327eb1e92452098b20d16e25ecd0a9f51c7
split: accept new output --filter=CMD option

* src/split.c: Include <signal.h>, <sys/wait.h> and "sig2str.h".
(FILTER_OPTION): New anonymous enum member.
(filter_command, filter_pid): New globals.
(open_pipes, open_pipes_alloc, n_open_pipes): Likewise.
(oldblocked, newblocked): Likewise.
(longopts): Add "filter".
(usage): Document --filter.
(create): Extend to create a pipe and fork "sh -c CMD".
(closeout): Adapt to close a pipe and wait for child process.
(cwrite): Call closeout, not just close.
(lines_chunk_split): FIXME
(bytes_chunk_extract): FIXME
(opid, ofile_open, lines_rr, main): FIXME
(ignorable): New function, to encapsulate EPIPE test.
src/split.c