summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-07-22 11:24:02 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-07-22 11:24:03 -0700
commita0c1aa216130680f890ded9e057bae24b0610d98 (patch)
treef1141f4b0266492021c0eafb3c5e8882b06db363
parentMerge branch 'nd/const-struct-cache-entry' (diff)
parentt0008: avoid SIGPIPE race condition on fifo (diff)
downloadtgif-a0c1aa216130680f890ded9e057bae24b0610d98.tar.xz
Merge branch 'jk/t0008-sigpipe-fix'
Fix for recent test breakage on 'master'. * jk/t0008-sigpipe-fix: t0008: avoid SIGPIPE race condition on fifo
-rwxr-xr-xt/t0008-ignores.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index a56db804cb..c29342d6bc 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -697,13 +697,21 @@ test_expect_success PIPE 'streaming support for --stdin' '
# shell, and then echo to the fd. We make sure to close it at
# the end, so that the subprocess does get EOF and dies
# properly.
+ #
+ # Similarly, we must keep "out" open so that check-ignore does
+ # not ever get SIGPIPE trying to write to us. Not only would that
+ # produce incorrect results, but then there would be no writer on the
+ # other end of the pipe, and we would potentially block forever trying
+ # to open it.
exec 9>in &&
+ exec 8<out &&
test_when_finished "exec 9>&-" &&
+ test_when_finished "exec 8<&-" &&
echo >&9 one &&
- read response <out &&
+ read response <&8 &&
echo "$response" | grep "^\.gitignore:1:one one" &&
echo >&9 two &&
- read response <out &&
+ read response <&8 &&
echo "$response" | grep "^:: two"
'