+ SKIP: {
+ skip 'only testing open files on Linux', 1 if $^O ne 'linux';
+ my $d = "/proc/$pid/fd";
+ skip "no $d on Linux" unless -d $d;
+ my @before = sort(glob("$d/*"));
+ my $addr = pack_sockaddr_un($sock);
+ open my $null, '<', '/dev/null' or BAIL_OUT "/dev/null: $!";
+ my @fds = map { fileno($null) } (0..2);
+ for (0..10) {
+ socket(my $c, AF_UNIX, SOCK_SEQPACKET, 0) or
+ BAIL_OUT "socket: $!";
+ connect($c, $addr) or BAIL_OUT "connect: $!";
+ $send_cmd->($c, \@fds, 'hi', MSG_EOR);
+ }
+ lei_ok('daemon-pid');
+ chomp($pid = $lei_out);
+ is($pid, $pid_again, 'pid unchanged after failed reqs');
+ my @after = sort(glob("$d/*"));
+ is_deeply(\@before, \@after, 'open files unchanged') or
+ diag explain([\@before, \@after]);;
+ }
+ lei_ok(qw(daemon-kill));