From f17a71de746360822104b6cfeac1fbcad2c8f294 Mon Sep 17 00:00:00 2001 From: Andy Lutomirski Date: Tue, 15 Sep 2015 18:24:11 -0700 Subject: 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. --- src/postfork.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/postfork.cpp') diff --git a/src/postfork.cpp b/src/postfork.cpp index 1eb958ad..29cf850c 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -569,12 +569,13 @@ bool do_builtin_io(const char *out, size_t outlen, const char *err, size_t errle bool success = true; if (out && outlen) { - if (write_loop(STDOUT_FILENO, out, outlen) < 0) { + int e = errno; debug_safe(0, "Error while writing to stdout"); safe_perror("write_loop"); success = false; + errno = e; } } -- cgit v1.2.3