1
0
mirror of https://github.com/golang/go synced 2024-11-17 23:54:51 -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:
Bryan C. Mills 2023-02-28 21:12:13 +00:00 committed by Bryan Mills
parent ec26277aec
commit 65fa9ce8b5

View File

@ -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)
}