summaryrefslogtreecommitdiff
path: root/libgo/go/syscall/syscall_unix_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/syscall/syscall_unix_test.go')
-rw-r--r--libgo/go/syscall/syscall_unix_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/libgo/go/syscall/syscall_unix_test.go b/libgo/go/syscall/syscall_unix_test.go
index 2f25d18bca9..b1fe78deba4 100644
--- a/libgo/go/syscall/syscall_unix_test.go
+++ b/libgo/go/syscall/syscall_unix_test.go
@@ -78,12 +78,16 @@ func TestFcntlFlock(t *testing.T) {
}
if os.Getenv("GO_WANT_HELPER_PROCESS") == "" {
// parent
- name := filepath.Join(os.TempDir(), "TestFcntlFlock")
+ tempDir, err := ioutil.TempDir("", "TestFcntlFlock")
+ if err != nil {
+ t.Fatalf("Failed to create temp dir: %v", err)
+ }
+ name := filepath.Join(tempDir, "TestFcntlFlock")
fd, err := syscall.Open(name, syscall.O_CREAT|syscall.O_RDWR|syscall.O_CLOEXEC, 0)
if err != nil {
t.Fatalf("Open failed: %v", err)
}
- defer syscall.Unlink(name)
+ defer os.RemoveAll(tempDir)
defer syscall.Close(fd)
if err := syscall.Ftruncate(fd, 1<<20); err != nil {
t.Fatalf("Ftruncate(1<<20) failed: %v", err)