aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-04-02 14:24:18 -0500
committerRob Landley <rob@landley.net>2019-04-02 14:24:18 -0500
commit113f5aa959a551e477347b86286d2ae82fe77875 (patch)
tree00f7b71d30d052e39533d87eab0a45e527620fc0
parent8978bbe38dd7df38c3cf71a9afbe40b1250440c8 (diff)
downloadtoybox-113f5aa959a551e477347b86286d2ae82fe77875.tar.gz
Don't emit random -EPIPE error messages in a pipeline, just exit silently.
-rw-r--r--lib/lib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 14cedb60..c4d871c2 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -55,11 +55,14 @@ void error_exit(char *msg, ...)
// Die with an error message and strerror(errno)
void perror_exit(char *msg, ...)
{
- va_list va;
+ // Die silently if our pipeline exited.
+ if (errno != EPIPE) {
+ va_list va;
- va_start(va, msg);
- verror_msg(msg, errno, va);
- va_end(va);
+ va_start(va, msg);
+ verror_msg(msg, errno, va);
+ va_end(va);
+ }
xexit();
}