author | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Mar 2012 06:16:33 +0000 (22:16 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Mar 2012 06:16:33 +0000 (22:16 -0800) |
* 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
: Mask SIGPIPE on the command channel going to a transport helper
disconnect from remote helpers more gently
Conflicts:
transport-helper.c
transport-helper.c | patch | blob | history |
diff --git a/transport-helper.c b/transport-helper.c
index 6f227e253bf638de37ce74347213657c23185afa..f6b3b1fb79468ef85eb9581c7d44ff04c1bb61bc 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
#include "remote.h"
#include "string-list.h"
#include "thread-utils.h"
+#include "sigchain.h"
static int debug;
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);