]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use os.TempDir instead of hard-coding /tmp
authorBryan C. Mills <bcmills@google.com>
Tue, 28 Feb 2023 21:12:13 +0000 (21:12 +0000)
committerBryan Mills <bcmills@google.com>
Tue, 28 Feb 2023 22:18:56 +0000 (22:18 +0000)
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>

src/runtime/testdata/testprog/lockosthread.go

index e9d7fdbc44a0cc9ce0dca8f4d2f7a557effc2ab8..90d98e497289fb7b2a8f0ced57328472b17984a4 100644 (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)
                }