Commit e9bcbc53 authored by Russ Cox's avatar Russ Cox

os: use /tmp again

R=adg
CC=golang-dev
https://golang.org/cl/1823041
parent 9028d6bf
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"io/ioutil" "io/ioutil"
. "os" . "os"
"strings" "strings"
"syscall"
"testing" "testing"
) )
...@@ -56,7 +57,13 @@ func size(name string, t *testing.T) int64 { ...@@ -56,7 +57,13 @@ func size(name string, t *testing.T) int64 {
func newFile(testName string, t *testing.T) (f *File) { func newFile(testName string, t *testing.T) (f *File) {
// Use a local file system, not NFS. // Use a local file system, not NFS.
f, err := ioutil.TempFile("", "_Go_"+testName) // On Unix, override $TMPDIR in case the user
// has it set to an NFS-mounted directory.
dir := ""
if syscall.OS != "windows" {
dir = "/tmp"
}
f, err := ioutil.TempFile(dir, "_Go_"+testName)
if err != nil { if err != nil {
t.Fatalf("open %s: %s", testName, err) t.Fatalf("open %s: %s", testName, err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment