Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03c1392a authored by Yabin Cui's avatar Yabin Cui Committed by android-build-merger
Browse files

Merge "libbase: fix the way to find temp dir." am: b13d4a31

am: 8a5f594b

Change-Id: I4a3c1afd78b567c4c379cfb25a6b8ae58c06b810
parents b850b9d5 8a5f594b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -57,7 +57,13 @@ char* mkdtemp(char* template_name) {

static std::string GetSystemTempDir() {
#if defined(__ANDROID__)
  return "/data/local/tmp";
  const char* tmpdir = "/data/local/tmp";
  if (access(tmpdir, R_OK | W_OK | X_OK) == 0) {
    return tmpdir;
  }
  // Tests running in app context can't access /data/local/tmp,
  // so try current directory if /data/local/tmp is not accessible.
  return ".";
#elif defined(_WIN32)
  char tmp_dir[MAX_PATH];
  DWORD result = GetTempPathA(sizeof(tmp_dir), tmp_dir);