}
use Digest::SHA qw(sha1_hex);
-use File::Temp qw/tempdir/;
use IO::Socket;
use IO::Socket::UNIX;
use Fcntl qw(:seek);
use Socket qw(IPPROTO_TCP TCP_NODELAY SOL_SOCKET);
use POSIX qw(mkfifo);
-require './t/common.perl';
-my $tmpdir = tempdir('httpd-corner-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+use PublicInbox::TestCommon;
+my ($tmpdir, $for_destroy) = tmpdir();
my $fifo = "$tmpdir/fifo";
ok(defined mkfifo($fifo, 0777), 'created FIFO');
my $err = "$tmpdir/stderr.log";
# filter out pipes inherited from the parent
my @this = `lsof -p $$`;
my $bad;
- sub extract_inodes {
+ my $extract_inodes = sub {
map {;
my @f = split(' ', $_);
my $inode = $f[-2];
$bad = $_ if $inode !~ /\A[0-9]+\z/;
$inode => 1;
} grep (/\bpipe\b/, @_);
- }
- my %child = extract_inodes(@lsof);
- my %parent = extract_inodes(@this);
+ };
+ my %child = $extract_inodes->(@lsof);
+ my %parent = $extract_inodes->(@this);
skip("inode not in expected format: $bad", 1) if defined($bad);
delete @child{(keys %parent)};
is_deeply([], [keys %child], 'no extra pipes with -W0');