Commit 6f643ce1 authored by Alex Brainman's avatar Alex Brainman Committed by Andrew Gerrand

runtime: leave directory before removing it in TestDLLPreloadMitigation

Fixes #15120

Change-Id: I1d9a192ac163826bad8b46e8c0b0b9e218e69570
Reviewed-on: https://go-review.googlesource.com/21520Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/21698
Run-TryBot: Andrew Gerrand <adg@golang.org>
Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
parent 16c42047
......@@ -780,6 +780,17 @@ func TestDLLPreloadMitigation(t *testing.T) {
t.Skip("skipping test: gcc is missing")
}
tmpdir, err := ioutil.TempDir("", "TestDLLPreloadMitigation")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer func() {
err := os.RemoveAll(tmpdir)
if err != nil {
t.Error(err)
}
}()
dir0, err := os.Getwd()
if err != nil {
t.Fatal(err)
......@@ -794,12 +805,6 @@ uintptr_t cfunc() {
SetLastError(123);
}
`
tmpdir, err := ioutil.TempDir("", "TestDLLPreloadMitigation")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer os.RemoveAll(tmpdir)
srcname := "nojack.c"
err = ioutil.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
if err != nil {
......
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