summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-03-04 22:16:33 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-03-04 22:16:33 -0800
commita4d7615453eff93838d496db6b533b327c8cadfc (patch)
tree397bc90b0b6b648161640cda81c0d83603ab2037 /transport-helper.c
parentMerge branch 'tr/maint-bundle-long-subject' into maint (diff)
parentdisconnect from remote helpers more gently (diff)
downloadtgif-a4d7615453eff93838d496db6b533b327c8cadfc.tar.xz
Merge branch 'sp/smart-http-failure-to-push' into maint
* sp/smart-http-failure-to-push: : Mask SIGPIPE on the command channel going to a transport helper disconnect from remote helpers more gently Conflicts: transport-helper.c
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 6f227e253b..f6b3b1fb79 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -9,6 +9,7 @@
#include "remote.h"
#include "string-list.h"
#include "thread-utils.h"
+#include "sigchain.h"
static int debug;
@@ -220,15 +221,21 @@ static struct child_process *get_helper(struct transport *transport)
static int disconnect_helper(struct transport *transport)
{
struct helper_data *data = transport->data;
- struct strbuf buf = STRBUF_INIT;
int res = 0;
if (data->helper) {
if (debug)
fprintf(stderr, "Debug: Disconnecting.\n");
if (!data->no_disconnect_req) {
- strbuf_addf(&buf, "\n");
- sendline(data, &buf);
+ /*
+ * Ignore write errors; there's nothing we can do,
+ * since we're about to close the pipe anyway. And the
+ * most likely error is EPIPE due to the helper dying
+ * to report an error itself.
+ */
+ sigchain_push(SIGPIPE, SIG_IGN);
+ xwrite(data->helper->in, "\n", 1);
+ sigchain_pop(SIGPIPE);
}
close(data->helper->in);
close(data->helper->out);