[PATCH] D53000: [Support] exit with custom return code for SIGPIPE
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 12 10:24:03 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL344372: [Support] exit with custom return code for SIGPIPE (authored by nickdesaulniers, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D53000
Files:
llvm/trunk/lib/Support/Unix/Signals.inc
Index: llvm/trunk/lib/Support/Unix/Signals.inc
===================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc
+++ llvm/trunk/lib/Support/Unix/Signals.inc
@@ -47,6 +47,7 @@
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <string>
+#include <sysexits.h>
#ifdef HAVE_BACKTRACE
# include BACKTRACE_HEADER // For backtrace().
#endif
@@ -334,6 +335,10 @@
if (auto OldInterruptFunction = InterruptFunction.exchange(nullptr))
return OldInterruptFunction();
+ // Send a special return code that drivers can check for, from sysexits.h.
+ if (Sig == SIGPIPE)
+ exit(EX_IOERR);
+
raise(Sig); // Execute the default handler.
return;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53000.169454.patch
Type: text/x-patch
Size: 760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181012/3ea870dc/attachment.bin>
More information about the llvm-commits
mailing list