]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-unix.t
TODO: update and add a few more items
[public-inbox.git] / t / httpd-unix.t
index 5ec70fd8f1836f74e7ccd7c239115e6db81eb74a..ceec127caa366b0001c1ba688891ce30875747b8 100644 (file)
@@ -12,9 +12,8 @@ foreach my $mod (qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)) {
        plan skip_all => "$mod missing for httpd-unix.t" if $@;
 }
 
-use File::Temp qw/tempdir/;
 use IO::Socket::UNIX;
-my $tmpdir = tempdir('httpd-unix-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my ($tmpdir, $for_destroy) = tmpdir();
 my $unix = "$tmpdir/unix.sock";
 my $psgi = './t/httpd-corner.psgi';
 my $out = "$tmpdir/out.log";
@@ -60,7 +59,7 @@ sub check_sock ($) {
 check_sock($unix);
 
 { # do not clobber existing socket
-       my %err = ( 'linux' => EADDRINUSE );
+       my %err = ( 'linux' => EADDRINUSE, 'freebsd' => EADDRINUSE );
        open my $out, '>>', "$tmpdir/1" or die "redirect failed: $!";
        open my $err, '>>', "$tmpdir/2" or die "redirect failed: $!";
        my $cmd = ['-httpd', '-l', $unix, '-W0', $psgi];