use Carp qw/croak/;
use POSIX qw/SIGTERM/;
+use Fcntl qw/F_SETFD/;
use Test::Builder;
use Perl::Destruct::Level level => 3;
} elsif ($pid == 0) {
setpgrp 0, 0 or croak "setpgrp(0, 0): $!";
close $rdr or croak "close(\$rdr): $!";
- open STDERR, '>&', $wtr or croak "open(STDERR, '>&', \$wtr): $!";
+ fcntl $wtr, F_SETFD, 0 or croak "fcntl(\$wtr, F_SETFD, 0): $!";
my @args = (
'--tool=memcheck',
'--leak-check=full',
'--leak-resolution=high',
'--num-callers=' . $callers,
- '--error-limit=yes'
+ '--error-limit=yes',
+ '--log-fd=' . fileno($wtr)
);
unless ($args{no_supp}) {
for (Test::Valgrind::Suppressions::supp_path(), $args{supp}) {
Valgrind 3.1.0 (L<http://valgrind.org>).
-L<Carp>, L<POSIX> (core modules since perl 5) and L<Test::Builder> (since 5.6.2).
+L<Carp>, L<Fcntl>, L<POSIX> (core modules since perl 5) and L<Test::Builder> (since 5.6.2).
L<Perl::Destruct::Level>.