mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 06:48:30 +08:00
Don't complain if do_builtin_io fails due to EPIPE
If stdio is dead due to EPIPE, there's no great reason to spew a stack dump. This will still write an error to stderr if stdout dies. This might be undesirable, but changing that should be considered separately.
This commit is contained in:
parent
0212314479
commit
f17a71de74
|
@ -1181,7 +1181,7 @@ void exec_job(parser_t &parser, job_t *j)
|
||||||
const std::string outbuff = wcs2string(stdout_buffer);
|
const std::string outbuff = wcs2string(stdout_buffer);
|
||||||
const std::string errbuff = wcs2string(stderr_buffer);
|
const std::string errbuff = wcs2string(stderr_buffer);
|
||||||
bool builtin_io_done = do_builtin_io(outbuff.data(), outbuff.size(), errbuff.data(), errbuff.size());
|
bool builtin_io_done = do_builtin_io(outbuff.data(), outbuff.size(), errbuff.data(), errbuff.size());
|
||||||
if (! builtin_io_done)
|
if (! builtin_io_done && errno != EPIPE)
|
||||||
{
|
{
|
||||||
show_stackframe();
|
show_stackframe();
|
||||||
}
|
}
|
||||||
|
|
|
@ -569,12 +569,13 @@ bool do_builtin_io(const char *out, size_t outlen, const char *err, size_t errle
|
||||||
bool success = true;
|
bool success = true;
|
||||||
if (out && outlen)
|
if (out && outlen)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (write_loop(STDOUT_FILENO, out, outlen) < 0)
|
if (write_loop(STDOUT_FILENO, out, outlen) < 0)
|
||||||
{
|
{
|
||||||
|
int e = errno;
|
||||||
debug_safe(0, "Error while writing to stdout");
|
debug_safe(0, "Error while writing to stdout");
|
||||||
safe_perror("write_loop");
|
safe_perror("write_loop");
|
||||||
success = false;
|
success = false;
|
||||||
|
errno = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user