From c4b714d3fe36fe5c1928711940a9e7b8c9fb7db3 Mon Sep 17 00:00:00 2001
From: David Crawshaw <david.crawshaw@zentus.com>
Date: Wed, 9 Jul 2014 14:12:30 -0400
Subject: [PATCH] os: no /tmp on android

LGTM=minux, bradfitz
R=golang-codereviews, minux, bradfitz
CC=golang-codereviews
https://golang.org/cl/104650043
---
 src/pkg/os/file_unix.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/pkg/os/file_unix.go b/src/pkg/os/file_unix.go
index 76168339d2..23d5f65360 100644
--- a/src/pkg/os/file_unix.go
+++ b/src/pkg/os/file_unix.go
@@ -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
 }
-- 
2.30.9