]> Cypherpunks repositories - gostls13.git/commitdiff
os: no /tmp on android
authorDavid Crawshaw <david.crawshaw@zentus.com>
Wed, 9 Jul 2014 18:12:30 +0000 (14:12 -0400)
committerDavid Crawshaw <david.crawshaw@zentus.com>
Wed, 9 Jul 2014 18:12:30 +0000 (14:12 -0400)
LGTM=minux, bradfitz
R=golang-codereviews, minux, bradfitz
CC=golang-codereviews
https://golang.org/cl/104650043

src/pkg/os/file_unix.go

index 76168339d23da597737654cf5809c73314c3cd12..23d5f6536023cb799d4eb531042e7b78ac02fd6d 100644 (file)
@@ -308,7 +308,11 @@ func basename(name string) string {
 func TempDir() string {
        dir := Getenv("TMPDIR")
        if dir == "" {
-               dir = "/tmp"
+               if runtime.GOOS == "android" {
+                       dir = "/data/local/tmp"
+               } else {
+                       dir = "/tmp"
+               }
        }
        return dir
 }