[compiler-rt] 03bd05f - [sanitizer] Use TMPDIR in Android test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 18 19:05:35 PDT 2021


Author: Vitaly Buka
Date: 2021-08-18T19:05:21-07:00
New Revision: 03bd05f0e844bf4f952f0ce3cc03887d1c1180d8

URL: https://github.com/llvm/llvm-project/commit/03bd05f0e844bf4f952f0ce3cc03887d1c1180d8
DIFF: https://github.com/llvm/llvm-project/commit/03bd05f0e844bf4f952f0ce3cc03887d1c1180d8.diff

LOG: [sanitizer] Use TMPDIR in Android test

TMPDIR was added long time ago, so no need to use EXTERNAL_STORAGE.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
index 863a4332105ae..0e269d682f979 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
@@ -77,11 +77,7 @@ static void temp_file_name(char *buf, size_t bufsize, const char *prefix) {
 #else
   const char *tmpdir = "/tmp";
 #if SANITIZER_ANDROID
-  // I don't know a way to query temp directory location on Android without
-  // going through Java interfaces. The code below is not ideal, but should
-  // work. May require "adb root", but it is needed for almost any use of ASan
-  // on Android already.
-  tmpdir = GetEnv("EXTERNAL_STORAGE");
+  tmpdir = GetEnv("TMPDIR");
 #endif
   internal_snprintf(buf, bufsize, "%s/%sXXXXXX", tmpdir, prefix);
   ASSERT_TRUE(mkstemp(buf));


        


More information about the llvm-commits mailing list