[sanitizer] Restore stderr when using forkpty() to spawn external symbolizer
authorKuba Brecka <kuba.brecka@gmail.com>
Mon, 11 Apr 2016 09:27:09 +0000 (09:27 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Mon, 11 Apr 2016 09:27:09 +0000 (09:27 +0000)
commit036d0600448d6137300eb0bfcbf99a24e8632204
tree86aa5cebcbfd170e26c98d4cb76d5a1bd49d5553
parent716a533a7f47c63cc2f30ce5bdf70958d81dff46
[sanitizer] Restore stderr when using forkpty() to spawn external symbolizer

In `AtosSymbolizer`, we're using `forkpty()` to create a new pseudo-terminal to communicate with the `atos` tool (we need that to avoid output buffering in interactive mode). This however redirects both stdout and stderr into a single stream, so when we read the output, we can't distinguish between errors and standard replies. Let's save&restore stderr to avoid that.

Differential Revision: http://reviews.llvm.org/D15073

llvm-svn: 265923
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc