diff --git a/libgo/go/syscall/creds_test.go b/libgo/go/syscall/creds_test.go index 6eaa97e57b8..b1894c66b07 100644 --- a/libgo/go/syscall/creds_test.go +++ b/libgo/go/syscall/creds_test.go @@ -31,14 +31,18 @@ func TestSCMCredentials(t *testing.T) { t.Fatalf("SetsockoptInt: %v", err) } - srv, err := net.FileConn(os.NewFile(uintptr(fds[0]), "")) + srvFile := os.NewFile(uintptr(fds[0]), "server") + defer srvFile.Close() + srv, err := net.FileConn(srvFile) if err != nil { t.Errorf("FileConn: %v", err) return } defer srv.Close() - cli, err := net.FileConn(os.NewFile(uintptr(fds[1]), "")) + cliFile := os.NewFile(uintptr(fds[1]), "client") + defer cliFile.Close() + cli, err := net.FileConn(cliFile) if err != nil { t.Errorf("FileConn: %v", err) return