Skip to content

Commit

Permalink
Change directory to $*TMPDIR and unlink closed UNIX sockets
Browse files Browse the repository at this point in the history
Fixes #718
  • Loading branch information
Kaiepi committed Apr 10, 2021
1 parent 2b556e0 commit 202dc89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S32-io/IO-Socket-INET-UNIX.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

0 comments on commit 202dc89

Please sign in to comment.