When you write to a pipe whose other end has been closed, you normally receive a SIGPIPE signal and die. However, if you choose to ignore that signal, as svn
does, then instead the write
returns with -1
and errno
set to EPIPE
whose English translation is "Broken pipe". And svn
chooses to display that error message when it fails to write something to its standard output.
head
terminates after it has written 10 lines from its input and as a result closes the pipe. svn
won't be able to write any more to that pipe. Most applications then die silently as the default behaviour when they're not ignoring SIGPIPE. svn
for some reason (maybe because it needs to do extra things before dying) chooses to ignore the SIGPIPE and determine that it can't write anymore to the pipe by checking the error status of the write
to the pipe.
You get the same error with:
bash -c 'trap "" PIPE; while echo foo; do :;done' | head
See:
strace -e write seq 10000 | head
(on Linux) to see what the default behaviour is when you're not ignoring SIGPIPE.