[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 15:17:23 PDT 2018


nickdesaulniers created this revision.
nickdesaulniers added a reviewer: jfb.
Herald added a subscriber: cfe-commits.

https://reviews.llvm.org/D53000 adds a special exit code for SIGPIPE (writing to a closed
reader), and rather than print a fatal warning, skips printing the
error.

Fixes PR25349, rdar://problem/14285346, b/77310947.


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
@@ -1401,6 +1401,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 == 71)
+      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.168716.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181008/ebea16b9/attachment.bin>


More information about the cfe-commits mailing list