From 141051027bdb9beaa4cb0a93c15e8cf3fbc64510 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 15 Oct 2015 14:46:46 +0000 Subject: Revert "Fix temporary directory computation on linux (pr25147)" I actually did not want to commit this without review, but I mistyped. :/ llvm-svn: 250412 --- lldb/source/Host/common/HostInfoBase.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'lldb/source/Host/common/HostInfoBase.cpp') diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp index 0f4324f83dd..3cb00a875e2 100644 --- a/lldb/source/Host/common/HostInfoBase.cpp +++ b/lldb/source/Host/common/HostInfoBase.cpp @@ -20,7 +20,6 @@ #include "llvm/ADT/Triple.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Host.h" -#include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include @@ -345,9 +344,19 @@ HostInfoBase::ComputeProcessTempFileDirectory(FileSpec &file_spec) bool HostInfoBase::ComputeTempFileBaseDirectory(FileSpec &file_spec) { - llvm::SmallVector tmpdir; - llvm::sys::path::system_temp_directory(/*ErasedOnReboot*/ true, tmpdir); - file_spec = FileSpec(std::string(tmpdir.data(), tmpdir.size()), true); + file_spec.Clear(); + + const char *tmpdir_cstr = getenv("TMPDIR"); + if (tmpdir_cstr == nullptr) + { + tmpdir_cstr = getenv("TMP"); + if (tmpdir_cstr == nullptr) + tmpdir_cstr = getenv("TEMP"); + } + if (!tmpdir_cstr) + return false; + + file_spec = FileSpec(tmpdir_cstr, false); return true; } -- cgit v1.2.3