On 2021-08-25 19:18:49 -0400, Nathan Hartman wrote:
> I don't see mention of it in the issue tracker. Please could you file
> it there?

Done: https://issues.apache.org/jira/browse/SVN-4879

> I started looking into it but ran out of time for now. Anyway, SIGPIPE
> is ignored throughout the client, for good reasons, since r848296:
> 
> (relevant bits of log message):
> 
>    - Ignore SIGPIPE, to prevent wedging the repos on network errors,
>     or when piping the output to a command that quits before all data
>     is read, e.g. head, more or less.
> 
> SIGPIPE is disabled in the client (and 2 other programs) by:
> 
> +#ifdef SIGPIPE
> +  /* Disable SIGPIPE generation for the platforms that have it. */
> +  apr_signal(SIGPIPE, SIG_IGN);
> +#endif
> 
> It would be easy to temporarily re-enable it before executing diff-cmd
> but first it's important to make sure that won't break another use
> case which the current disabling is handling. (An example of one
> question that comes to mind: is it possible to use --diff-cmd with
> 'svn log -r#### --diff' and if so are there any ramifications to
> re-enabling SIGPIPE in that scenario? I haven't checked yet.)

I added a simpler suggestion in the report:

A possible fix (to be tested): instead of ignoring SIGPIPE (using
SIG_IGN), use a handler that does nothing. That way, when a command is
executed, SIGPIPE will be reset to the default action in the command
(i.e. killing the command, unless the command itself changes how it
handles SIGPIPE).

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to