diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-19 11:08:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-20 10:19:12 -0700 |
commit | 0c4dd67a048b39470b9b95912e4912fecc405a85 (patch) | |
tree | b785fea2d6cfedd40a3e9205dd22adf05d474944 /convert.c | |
parent | 00b7cbfcb36b6679c64ad0566c0fc251f7e979fe (diff) | |
download | git-0c4dd67a048b39470b9b95912e4912fecc405a85.tar.gz |
filter_buffer_or_fd(): ignore EPIPEjc/ignore-epipe-in-filter
We are explicitly ignoring SIGPIPE, as we fully expect that the
filter program may not read our output fully. Ignore EPIPE that
may come from writing to it as well.
A new test was stolen from Jeff's suggestion.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert.c')
-rw-r--r-- | convert.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -356,9 +356,14 @@ static int filter_buffer_or_fd(int in, int out, void *data) sigchain_push(SIGPIPE, SIG_IGN); if (params->src) { - write_err = (write_in_full(child_process.in, params->src, params->size) < 0); + write_err = (write_in_full(child_process.in, + params->src, params->size) < 0); + if (errno == EPIPE) + write_err = 0; } else { write_err = copy_fd(params->fd, child_process.in); + if (write_err == COPY_WRITE_ERROR && errno == EPIPE) + write_err = 0; } if (close(child_process.in)) |