Re: [PATCH v3 01/10] built-in add -i/-p: treat SIGPIPE as EOF
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Jan 17, 2020, 14:32 UTC
- Message-ID
- <20200117143236.GA11737@szeder.dev>
- In-Reply-To
- <20200113170417.GK32750@szeder.dev>
On Mon, Jan 13, 2020 at 06:04:17PM +0100, SZEDER Gábor wrote:
Show 10 quoted lines
> and 'GIT_TEST_ADD_I_USE_BUILTIN=1 ./t3701-add-interactive.sh -r 39,49' > fails with: > > + test_must_fail force_color git add -p > about to run diffFilter > attempting to xwrite() 224 bytes to a fd with revents flags 0x4 > test_must_fail: died by signal 13: force_color git add -p > > I don't understand why we get SIGPIPE right away instead of some error > that we can act upon (ECONNRESET?).
Doh', because it's a pipe, not a socket, that's why. pipe(7):
"If all file descriptors referring to the read end of a pipe have been closed, then a write(2) will cause a SIGPIPE signal to be generated for the calling process."
So ECONNRESET is definitely not the right error to set on POLLERR, though I'm still not sure what the right one would be (perhaps EPIPE?).