Use /data/local/tmp as temp directory on android
If no temp directory specified by the user on android then fall back
to /data/local/tmp what is always present on the device. It removes
the dependency of specifying TMPDIR for executing platform commands
on android.
Differential revision: http://reviews.llvm.org/D9569
llvm-svn: 236843
diff --git a/lldb/source/Host/android/HostInfoAndroid.cpp b/lldb/source/Host/android/HostInfoAndroid.cpp
index f44b6c6..a5695f6 100644
--- a/lldb/source/Host/android/HostInfoAndroid.cpp
+++ b/lldb/source/Host/android/HostInfoAndroid.cpp
@@ -87,3 +87,15 @@
return FileSpec();
}
+
+bool
+HostInfoAndroid::ComputeTempFileBaseDirectory(FileSpec &file_spec)
+{
+ if (HostInfoLinux::ComputeTempFileBaseDirectory(file_spec))
+ return true;
+
+ // If the default mechanism for computing the temp directory failed then
+ // fall back to /data/local/tmp
+ file_spec = FileSpec("/data/local/tmp", false);
+ return true;
+}