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
This commit is contained in:
Junio C Hamano 2018-04-11 13:09:57 +09:00
Родитель 9b59d8869d a0d51e8d0e
Коммит 7a94b26f17
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -5,6 +5,7 @@
#include "run-command.h" #include "run-command.h"
#include "url.h" #include "url.h"
#include "prompt.h" #include "prompt.h"
#include "sigchain.h"
void credential_init(struct credential *c) void credential_init(struct credential *c)
{ {
@ -227,8 +228,10 @@ static int run_credential_helper(struct credential *c,
return -1; return -1;
fp = xfdopen(helper.in, "w"); fp = xfdopen(helper.in, "w");
sigchain_push(SIGPIPE, SIG_IGN);
credential_write(c, fp); credential_write(c, fp);
fclose(fp); fclose(fp);
sigchain_pop(SIGPIPE);
if (want_output) { if (want_output) {
int r; int r;