mirror of
https://github.com/golang/go
synced 2024-11-18 02:44:48 -07:00
runtime: use os.TempDir instead of hard-coding /tmp
On Android, /tmp does not exist. Change-Id: Ib1797d79d89704a7a9466ad94efd57d2848b3b57 Reviewed-on: https://go-review.googlesource.com/c/go/+/472255 TryBot-Bypass: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
This commit is contained in:
parent
ec26277aec
commit
65fa9ce8b5
@ -155,7 +155,7 @@ func LockOSThreadAvoidsStatePropagation() {
|
||||
}
|
||||
// Chdir to somewhere else on this thread.
|
||||
// On systems other than Linux, this is a no-op.
|
||||
if err := chdir("/tmp"); err != nil {
|
||||
if err := chdir(os.TempDir()); err != nil {
|
||||
println("failed to chdir:", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user