mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
io: Silence write error with EPIPE
With something like ``` history | head -n 1 ``` this would error "write: Broken pipe", which is just annoying. There is no *problem* here, `head` closes this on purpose. Fixes #7924.
This commit is contained in:
parent
a918cabf5e
commit
3e473b9f37
1 changed files with 3 additions and 1 deletions
|
@ -306,7 +306,9 @@ void fd_output_stream_t::append(const wchar_t *s, size_t amt) {
|
|||
int res = wwrite_to_fd(s, amt, this->fd_);
|
||||
if (res < 0) {
|
||||
// TODO: this error is too aggressive, e.g. if we got SIGINT we should not complain.
|
||||
wperror(L"write");
|
||||
if (errno != EPIPE) {
|
||||
wperror(L"write");
|
||||
}
|
||||
errored_ = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue