aboutsummaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-29 12:59:08 -0700
committerJunio C Hamano <gitster@pobox.com>2016-04-29 12:59:08 -0700
commitd689301043f6dc14d71e7d33e1b8ea600ae1b67b (patch)
treede02603666c3fee3c3c1f93b826c27d020d40f1c /run-command.c
parent60b3e9b959f4423f6927ef77e7097bea3ad24e45 (diff)
parentc4b27511ab0e3ec464e3fd3d4711251a17b1f733 (diff)
downloadgit-d689301043f6dc14d71e7d33e1b8ea600ae1b67b.tar.gz
git-d689301043f6dc14d71e7d33e1b8ea600ae1b67b.tar.xz
Merge branch 'jk/push-client-deadlock-fix'
"git push" from a corrupt repository that attempts to push a large number of refs deadlocked; the thread to relay rejection notices for these ref updates blocked on writing them to the main thread, after the main thread at the receiving end notices that the push failed and decides not to read these notices and return a failure. * jk/push-client-deadlock-fix: t5504: drop sigpipe=ok from push tests fetch-pack: isolate sigpipe in demuxer thread send-pack: isolate sigpipe in demuxer thread run-command: teach async threads to ignore SIGPIPE send-pack: close demux pipe before finishing async process
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 8c7115ade..e4593cd99 100644
--- a/run-command.c
+++ b/run-command.c
@@ -590,6 +590,16 @@ static void *run_thread(void *data)
struct async *async = data;
intptr_t ret;
+ if (async->isolate_sigpipe) {
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGPIPE);
+ if (pthread_sigmask(SIG_BLOCK, &mask, NULL) < 0) {
+ ret = error("unable to block SIGPIPE in async thread");
+ return (void *)ret;
+ }
+ }
+
pthread_setspecific(async_key, async);
ret = async->proc(async->proc_in, async->proc_out, async->data);
return (void *)ret;