fetch-pack: isolate sigpipe in demuxer thread

In commit 9ff18fa (fetch-pack: ignore SIGPIPE in sideband demuxer, 2016-02-24), we started using sigchain_push() to ignore SIGPIPE in the async demuxer thread. However, this is rather clumsy, as it ignores SIGPIPE for the entire process, including the main thread. At the time we didn't have any per-thread signal support, but we now we do. Let's use it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Apr 19, 2016 at 18:50 UTC df85757244c47394d42de2a45bd39522ee0c3b1d
1 file changed +1 -3
fetch-pack.c
+1 -3
@@ -15,7 +15,6 @@
15 #include "version.h"
16 #include "prio-queue.h"
17 #include "sha1-array.h"
18 -#include "sigchain.h"
18
19 static int transfer_unpack_limit = -1;
20 static int fetch_unpack_limit = -1;
@@ -674,10 +673,8 @@ static int sideband_demux(int in, int out, void *data)
673 int *xd = data;
674 int ret;
675
677 - sigchain_push(SIGPIPE, SIG_IGN);
676 ret = recv_sideband("fetch-pack", xd[0], out);
677 close(out);
680 - sigchain_pop(SIGPIPE);
678 return ret;
679 }
680
@@ -701,6 +698,7 @@ static int get_pack(struct fetch_pack_args *args,
698 demux.proc = sideband_demux;
699 demux.data = xd;
700 demux.out = -1;
701 + demux.isolate_sigpipe = 1;
702 if (start_async(&demux))
703 die("fetch-pack: unable to fork off sideband"
704 " demultiplexer");