From e806121826fb64f62ee6be0f456dadd33a3a799e Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Sat, 10 Apr 2021 08:06:08 -0300 Subject: [PATCH] Change directory to $*TMPDIR and unlink closed UNIX sockets Fixes #732 --- S32-io/IO-Socket-INET-UNIX.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/S32-io/IO-Socket-INET-UNIX.t b/S32-io/IO-Socket-INET-UNIX.t index d1f036ad02..5e3ff89d4e 100644 --- a/S32-io/IO-Socket-INET-UNIX.t +++ b/S32-io/IO-Socket-INET-UNIX.t @@ -6,10 +6,12 @@ plan 8; if $*DISTRO.is-win { skip-rest 'UNIX socket support on Windows NYI'; } else { + chdir $*TMPDIR; + my IO::Socket::INET:_ $server; my IO::Socket::INET:_ $client; my IO::Socket::INET:_ $accepted; - my Str:D $host = $*TMPDIR.add("test-$*PID.sock").Str; + my Str:D $host = "./test-$*PID.sock"; my Str:D $sent = 'Hello, world!'; my Str:_ $received; LEAVE $host.IO.unlink if $host.IO.e; @@ -38,6 +40,8 @@ if $*DISTRO.is-win { lives-ok { $server.close; }, 'can close TCP UNIX socket servers'; + + LEAVE $host.IO.unlink with $server; } # vim: expandtab shiftwidth=4