]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: remove TMPDIR logic for iOS
authorDavid Crawshaw <crawshaw@golang.org>
Mon, 27 Jul 2015 20:40:40 +0000 (16:40 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Mon, 27 Jul 2015 21:28:31 +0000 (21:28 +0000)
Seems like the simplest solution for 1.5. All the parts of the test
suite I can run on my current device (for which my exception handler
fix no longer works, apparently) pass without this code. I'll move it
into x/mobile/app.

Fixes #11884

Change-Id: I2da40c8c7b48a4c6970c4d709dd7c148a22e8727
Reviewed-on: https://go-review.googlesource.com/12721
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/cgo/tmpdir_darwin.go [deleted file]

diff --git a/src/runtime/cgo/tmpdir_darwin.go b/src/runtime/cgo/tmpdir_darwin.go
deleted file mode 100644 (file)
index 1239c70..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build arm arm64
-
-package cgo
-
-/*
-#cgo CFLAGS: -x objective-c
-#cgo LDFLAGS: -framework CoreFoundation -framework Foundation
-
-#include <sys/param.h>
-#include <CoreFoundation/CFString.h>
-#include <Foundation/NSPathUtilities.h>
-
-char tmpdir[MAXPATHLEN];
-
-char* loadtmpdir() {
-       tmpdir[0] = 0;
-       CFStringRef path = (CFStringRef)NSTemporaryDirectory();
-       CFStringGetCString(path, tmpdir, sizeof(tmpdir), kCFStringEncodingUTF8);
-       return tmpdir;
-}
-*/
-import "C"
-
-func init() {
-       if Getenv("TMPDIR") != "" {
-               return
-       }
-       dir := C.GoString(C.loadtmpdir())
-       if len(dir) == 0 {
-               return
-       }
-       if dir[len(dir)-1] == '/' {
-               dir = dir[:len(dir)-1]
-       }
-       Setenv("TMPDIR", dir)
-}