diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-04-11 13:09:57 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-11 13:09:57 +0900 |
commit | 7a94b26f177b3e9ad20c61a3bc0d3e4ea36e554e (patch) | |
tree | 2d32c79da21e9e3b12d1492b785d475fc0aa0f4f /credential.c | |
parent | Merge branch 'lv/tls-1.3' (diff) | |
parent | credential: ignore SIGPIPE when writing to credential helpers (diff) | |
download | tgif-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
Diffstat (limited to 'credential.c')
-rw-r--r-- | credential.c | 3 |
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; |