瀏覽代碼

Merged revision(s) 31720 from trunk:
* Use /data/local/tmp/ as a fallback temp dir on Android.
........

git-svn-id: branches/fixes_3_0@31920 -

yury 10 年之前
父節點
當前提交
9fe0ec9663
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      rtl/unix/sysutils.pp

+ 8 - 1
rtl/unix/sysutils.pp

@@ -1525,7 +1525,14 @@ begin
     If (Result='') Then
     If (Result='') Then
       Result:=GetEnvironmentVariable('TMPDIR');
       Result:=GetEnvironmentVariable('TMPDIR');
     if (Result='') then
     if (Result='') then
-      Result:='/tmp/' // fallback.
+      begin
+      // fallback.
+      {$ifdef android}
+        Result:='/data/local/tmp/';
+      {$else}
+        Result:='/tmp/';
+      {$endif android}
+      end;
     end;
     end;
   if (Result<>'') then
   if (Result<>'') then
     Result:=IncludeTrailingPathDelimiter(Result);
     Result:=IncludeTrailingPathDelimiter(Result);