Skip to content

Commit

Permalink
Merge branch 'jk/t0008-sigpipe-fix'
Browse files Browse the repository at this point in the history
Fix for recent test breakage on 'master'.

* jk/t0008-sigpipe-fix:
  t0008: avoid SIGPIPE race condition on fifo
  • Loading branch information
Junio C Hamano committed Jul 22, 2013
2 parents d3aeb31 + 4783e7e commit a0c1aa2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions t/t0008-ignores.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
'

Expand Down

0 comments on commit a0c1aa2

Please sign in to comment.