summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-04 22:16:35 -0800
committerJunio C Hamano <gitster@pobox.com>2012-03-04 22:16:35 -0800
commitc08afaf7b6675f3780f041870233e31b77ac4ce8 (patch)
tree5c7c3ad7f08bc21bdf52603d4ad4df5c60819ec1
parenta4d7615453eff93838d496db6b533b327c8cadfc (diff)
parent6424c2ad12cf6c3feb533fab9c4dded7514d0f4c (diff)
downloadgit-c08afaf7b6675f3780f041870233e31b77ac4ce8.tar.gz
Merge branch 'jb/filter-ignore-sigpipe' into maint
* jb/filter-ignore-sigpipe: Ignore SIGPIPE when running a filter driver
-rw-r--r--convert.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/convert.c b/convert.c
index 12868ed7bd..33373b3ac0 100644
--- a/convert.c
+++ b/convert.c
@@ -2,6 +2,7 @@
#include "attr.h"
#include "run-command.h"
#include "quote.h"
+#include "sigchain.h"
/*
* convert.c - convert a file when checking it out and checking it in.
@@ -360,12 +361,16 @@ static int filter_buffer(int in, int out, void *data)
if (start_command(&child_process))
return error("cannot fork to run external filter %s", params->cmd);
+ sigchain_push(SIGPIPE, SIG_IGN);
+
write_err = (write_in_full(child_process.in, params->src, params->size) < 0);
if (close(child_process.in))
write_err = 1;
if (write_err)
error("cannot feed the input to external filter %s", params->cmd);
+ sigchain_pop(SIGPIPE);
+
status = finish_command(&child_process);
if (status)
error("external filter %s failed %d", params->cmd, status);