commit | 2648243ebdb1df3dbef182fa062bf1a2a2d06109 | [log] [tgz] |
---|---|---|
author | Kostya Serebryany <kcc@google.com> | Thu Jan 05 04:32:19 2017 +0000 |
committer | Kostya Serebryany <kcc@google.com> | Thu Jan 05 04:32:19 2017 +0000 |
tree | bef6592e14629e427405c2992d8e2d2216236898 | |
parent | 6196eaf0ae339ecfe8523eda37b1c758560786d2 [diff] [blame] |
[libFuzzer] use /tmp (or $TMPDIR, if present) to store temp files during merge llvm-svn: 291078
diff --git a/llvm/lib/Fuzzer/FuzzerIOPosix.cpp b/llvm/lib/Fuzzer/FuzzerIOPosix.cpp index 720bc13..6d8edf6 100644 --- a/llvm/lib/Fuzzer/FuzzerIOPosix.cpp +++ b/llvm/lib/Fuzzer/FuzzerIOPosix.cpp
@@ -83,6 +83,12 @@ return Res; } +std::string TmpDir() { + if (auto Env = getenv("TMPDIR")) + return Env; + return "/tmp"; +} + } // namespace fuzzer #endif // LIBFUZZER_POSIX