From: Junio C Hamano <gitster@pobox•com>
To: Johannes Sixt <j6t@kdbg•org>
Cc: Patrick Reynolds <patrick.reynolds@github•com>, git@vger•kernel.org
Subject: Re: [PATCH v2] unblock and unignore SIGPIPE
Date: Mon, 22 Sep 2014 10:30:38 -0700 [thread overview]
Message-ID: <xmqqwq8vlg01.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <541D3E0C.4030400@kdbg.org> (Johannes Sixt's message of "Sat, 20 Sep 2014 10:42:52 +0200")
Johannes Sixt <j6t@kdbg•org> writes:
>> +static void restore_sigpipe_to_default(void)
>> +{
>> + sigset_t unblock;
>> +
>> + sigemptyset(&unblock);
>> + sigaddset(&unblock, SIGPIPE);
>> + sigprocmask(SIG_UNBLOCK, &unblock, NULL);
>> + signal(SIGPIPE, SIG_DFL);
>> +}
>
> This does not build on MinGW due to missing sigaddset() and
> sigprocmask(). I've a patch that adds dummies for them (but I ran out of
> time to complete it for submission). But then the test cases ...
>
>> +test_expect_success 'a constipated git dies with SIGPIPE' '
>> + OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 )
>> + test "$OUT" -eq 141
>> +'
>> +
>> +test_expect_success 'a constipated git dies with SIGPIPE even if parent ignores it' '
>> + OUT=$( ((trap "" PIPE; large_git; echo $? 1>&3) | :) 3>&1 )
>> + test "$OUT" -eq 141
>> +'
>
> ... fail always because we neither get SIGPIPE (we don't have it on
> Windows) nor do we see a write error (e.g. EPIPE) when writing to the
> pipe. Should I protect these tests with !MINGW or would it be an option
> to drop these tests alltogether?
Let's do !MINGW for now, unless somebody can think of a reason why
this change and tests are a bad idea (e.g. "we are not in the
business of preventing users from shooting themselves; have the
users bug those who wrote the software that spawns us with SIGPIPE
ignored", to which I am sympathetic to some degree but not very much
because I am also a practical person).
Thanks.
next prev parent reply other threads:[~2014-09-22 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 16:57 [PATCH v2] unblock and unignore SIGPIPE Patrick Reynolds
2014-09-18 17:35 ` Junio C Hamano
2014-09-18 18:39 ` James Nylen
2014-09-20 8:42 ` Johannes Sixt
2014-09-22 17:30 ` Junio C Hamano [this message]
2014-09-22 18:24 ` [PATCH] mingw.h: add dummy functions for sigset_t operations Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwq8vlg01.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=j6t@kdbg$(echo .)org \
--cc=patrick.reynolds@github$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox