Commits

Toby Inkster committed b37e3bd Merge

Merge pull request #1 from pdcawley/master

Make t/iod-02filehandles.t clean up after itself

Comments (0)

Files changed (1)

t/iod-02filehandles.t

 use FileHandle;
 use IO::File;
 use IO::Socket::INET;
+use File::Temp qw/tempdir/;
 
 use IO::Detect qw( is_filehandle FileHandle );
 
 plan skip_all => "only works on Linux" unless $^O =~ /linux/i;
 
 my $SLEEP = 5;
-my $FIFO  = "/tmp/myfifo";
 
-unlink $FIFO;
+my $tmpdir = tempdir( CLEANUP => 1 );
+my $FIFO  = "$tmpdir/myfifo";
+
 my $pid = fork;
 die "$0: fork" unless defined $pid;
 if ($pid == 0) {
 }
 
 done_testing();
+