From 113f5aa959a551e477347b86286d2ae82fe77875 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 2 Apr 2019 14:24:18 -0500 Subject: Don't emit random -EPIPE error messages in a pipeline, just exit silently. --- lib/lib.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') 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(); } -- cgit v1.2.3