[PATCH] D53001: [Driver] check for exit code from SIGPIPE

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 8 16:14:29 PDT 2018


nickdesaulniers updated this revision to Diff 168728.
nickdesaulniers added a comment.

- prefer EX_IOERR from sysexits.h


Repository:
  rC Clang

https://reviews.llvm.org/D53001

Files:
  lib/Driver/Driver.cpp


Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -77,6 +77,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include <map>
 #include <memory>
+#include <sysexits.h>
 #include <utility>
 #if LLVM_ON_UNIX
 #include <unistd.h> // getpid
@@ -1401,6 +1402,11 @@
         C.CleanupFileMap(C.getFailureResultFiles(), JA, true);
     }
 
+    // llvm/lib/Support/Unix/Signals.inc will exit with a special return code
+    // for SIGPIPE. Do not print diagnostics for this case.
+    if (Res == EX_IOERR)
+      continue;
+
     // Print extra information about abnormal failures, if possible.
     //
     // This is ad-hoc, but we don't want to be excessively noisy. If the result


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53001.168728.patch
Type: text/x-patch
Size: 773 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181008/f94eddf9/attachment.bin>


More information about the cfe-commits mailing list