We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d94674c commit 0c3b977Copy full SHA for 0c3b977
compiler-rt/lib/sanitizer_common/sanitizer_file.cpp
@@ -36,15 +36,16 @@ void RawWrite(const char *buffer) {
36
37
void ReportFile::ReopenIfNecessary() {
38
mu->CheckLocked();
39
- if (!lastOpenFailed)
40
- if (fd == kStdoutFd || fd == kStderrFd)
41
- return;
42
-
43
uptr pid = internal_getpid();
44
if (lastOpenFailed && fd_pid != pid) {
+ // If lastOpenFailed is set then we fellback to stderr. If this is a new
+ // process, mark fd as invalid so we attempt to open again.
+ CHECK_EQ(fd, kStderrFd);
45
fd = kInvalidFd;
46
lastOpenFailed = false;
47
}
+ if (fd == kStdoutFd || fd == kStderrFd)
48
+ return;
49
50
// If in tracer, use the parent's file.
51
if (pid == stoptheworld_tracer_pid)
0 commit comments