[sanitizer] Use TMPDIR in Android test

TMPDIR was added long time ago, so no need to use EXTERNAL_STORAGE.
This commit is contained in:
Vitaly Buka 2021-08-18 19:02:02 -07:00
parent 9329438244
commit 03bd05f0e8
1 changed files with 1 additions and 5 deletions

View File

@ -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));