- open my $fh, '>', $f or die "failed to open $f: $!\n";
- flock($fh, LOCK_EX) or die "LOCK_EX failed on $f: $!\n";
- eval 'use Inline C => $vfork_spawn.$fdpass.$set_nodatacow';
- # . ', BUILD_NOISY => 1';
+ open my $oldout, '>&', \*STDOUT or die "dup(1): $!";
+ open my $olderr, '>&', \*STDERR or die "dup(2): $!";
+ open my $fh, '+>', $f or die "open($f): $!";
+ open STDOUT, '>&', $fh or die "1>$f: $!";
+ open STDERR, '>&', $fh or die "2>$f: $!";
+ STDERR->autoflush(1);
+ STDOUT->autoflush(1);
+
+ # CentOS 7.x ships Inline 0.53, 0.64+ has built-in locking
+ flock($fh, LOCK_EX) or die "LOCK_EX($f): $!";
+ eval <<'EOM';
+use Inline C => $all_libc, BUILD_NOISY => 1;
+EOM