summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-04-11 13:09:57 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-04-11 13:09:57 +0900
commit7a94b26f177b3e9ad20c61a3bc0d3e4ea36e554e (patch)
tree2d32c79da21e9e3b12d1492b785d475fc0aa0f4f
parentMerge branch 'lv/tls-1.3' (diff)
parentcredential: ignore SIGPIPE when writing to credential helpers (diff)
downloadtgif-7a94b26f177b3e9ad20c61a3bc0d3e4ea36e554e.tar.xz
Merge branch 'eb/cred-helper-ignore-sigpipe'
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
-rw-r--r--credential.c3
1 files changed, 3 insertions, 0 deletions
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;