diff options
author | Rob Landley <rob@landley.net> | 2019-04-02 14:24:18 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-04-02 14:24:18 -0500 |
commit | 113f5aa959a551e477347b86286d2ae82fe77875 (patch) | |
tree | 00f7b71d30d052e39533d87eab0a45e527620fc0 /lib | |
parent | 8978bbe38dd7df38c3cf71a9afbe40b1250440c8 (diff) | |
download | toybox-113f5aa959a551e477347b86286d2ae82fe77875.tar.gz |
Don't emit random -EPIPE error messages in a pipeline, just exit silently.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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(); } |