[PATCH] D28977: [libFuzzer] Implement TmpDir() for Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 17:57:13 PST 2017


mpividori created this revision.

Repository:
  rL LLVM

https://reviews.llvm.org/D28977

Files:
  lib/Fuzzer/FuzzerIOWindows.cpp


Index: lib/Fuzzer/FuzzerIOWindows.cpp
===================================================================
--- lib/Fuzzer/FuzzerIOWindows.cpp
+++ lib/Fuzzer/FuzzerIOWindows.cpp
@@ -287,7 +287,12 @@
   return FileName.substr(0, LocationLen + DirLen);
 }
 
-std::string TmpDir() { return "TODO: implement TmpDir"; }
+std::string TmpDir() {
+  if (auto Env = getenv("TMP"))
+    return Env;
+  Printf("Couldn't read TMP environment variable\n");
+  exit(1);
+}
 
 bool IsInterestingCoverageFile(const std::string &FileName) {
   if (FileName.find("Program Files") != std::string::npos)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28977.85226.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170121/26bdcd90/attachment.bin>


More information about the llvm-commits mailing list