Skip to content

Commit df85757

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3e8b06d commit df85757

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fetch-pack.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "version.h"
1616
#include "prio-queue.h"
1717
#include "sha1-array.h"
18-
#include "sigchain.h"
1918

2019
static int transfer_unpack_limit = -1;
2120
static int fetch_unpack_limit = -1;
@@ -674,10 +673,8 @@ static int sideband_demux(int in, int out, void *data)
674673
int *xd = data;
675674
int ret;
676675

677-
sigchain_push(SIGPIPE, SIG_IGN);
678676
ret = recv_sideband("fetch-pack", xd[0], out);
679677
close(out);
680-
sigchain_pop(SIGPIPE);
681678
return ret;
682679
}
683680

@@ -701,6 +698,7 @@ static int get_pack(struct fetch_pack_args *args,
701698
demux.proc = sideband_demux;
702699
demux.data = xd;
703700
demux.out = -1;
701+
demux.isolate_sigpipe = 1;
704702
if (start_async(&demux))
705703
die("fetch-pack: unable to fork off sideband"
706704
" demultiplexer");

0 commit comments

Comments
 (0)