+
+ # try reuse STDIN if it's already /dev/null
+ open $self->{log_fh}, '+>', '/dev/null' or die "open: $!";
+ my @l = stat($self->{log_fh}) or die "stat: $!";
+ my @s = stat(STDIN) or die "stat(STDIN): $!";
+ if ("@l[0, 1]" eq "@s[0, 1]") {
+ my $f = fcntl(STDIN, F_GETFL, 0) // die "F_GETFL: $!";
+ $self->{log_fh} = *STDIN{IO} if $f & O_RDWR;
+ }