From: Junio C Hamano Date: Fri, 30 Mar 2018 19:42:03 +0000 (-0700) Subject: Merge branch 'eb/cred-helper-ignore-sigpipe' into next X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c48e98c1b1705fa4d1792757dce16d3b6264008c?hp=4f137314080fa66b33f7bb342a1b6926020f7770 Merge branch 'eb/cred-helper-ignore-sigpipe' into next When credential helper exits very quickly without reading its input, it used to cause Git to die with SIGPIPE, which has been fixed. * eb/cred-helper-ignore-sigpipe: credential: ignore SIGPIPE when writing to credential helpers --- diff --git a/credential.c b/credential.c index 9747f47b18..62be651b03 100644 --- a/credential.c +++ b/credential.c @@ -5,6 +5,7 @@ #include "run-command.h" #include "url.h" #include "prompt.h" +#include "sigchain.h" void credential_init(struct credential *c) { @@ -227,8 +228,10 @@ static int run_credential_helper(struct credential *c, return -1; fp = xfdopen(helper.in, "w"); + sigchain_push(SIGPIPE, SIG_IGN); credential_write(c, fp); fclose(fp); + sigchain_pop(SIGPIPE); if (want_output) { int r;