Perl 5.14+ gained the ability to autoload IO::File
(and IO::Handle) on missing methods, so relying on
this breaks under 5.10.1.
There's no reason to load IO::File or IO::Handle
when built-in perlops work fine and are even a hair
faster.
$async->async_pass($self->{psgi_env}->{'psgix.io'},
$qx_fh, \$buf);
} elsif (defined $r) {
$async->async_pass($self->{psgi_env}->{'psgix.io'},
$qx_fh, \$buf);
} elsif (defined $r) {
- $r ? $qx_fh->write($buf) : event_step($self, undef);
+ $r ? (print $qx_fh $buf) : event_step($self, undef);
} else {
return if $! == EAGAIN; # try again when notified
goto reread if $! == EINTR;
} else {
return if $! == EAGAIN; # try again when notified
goto reread if $! == EINTR;
waitpid($pid, 0);
is($?, 0, 'curl exited successfully');
is(-s $cerr, 0, 'no errors from curl');
waitpid($pid, 0);
is($?, 0, 'curl exited successfully');
is(-s $cerr, 0, 'no errors from curl');
- $cout->seek(0, SEEK_SET);
+ seek($cout, 0, SEEK_SET);
is(<$cout>, sha1_hex($str), 'read expected body');
open my $fh, '-|', qw(curl -sS), "$base/async-big" or die $!;
is(<$cout>, sha1_hex($str), 'read expected body');
open my $fh, '-|', qw(curl -sS), "$base/async-big" or die $!;
use PublicInbox::Git;
use PublicInbox::Import;
use PublicInbox::Spawn qw(spawn);
use PublicInbox::Git;
use PublicInbox::Import;
use PublicInbox::Spawn qw(spawn);
-use IO::File;
-use Fcntl qw(:DEFAULT);
+use Fcntl qw(:DEFAULT SEEK_SET);
use File::Temp qw/tempfile/;
use PublicInbox::TestCommon;
my ($dir, $for_destroy) = tmpdir();
use File::Temp qw/tempfile/;
use PublicInbox::TestCommon;
my ($dir, $for_destroy) = tmpdir();
my $in = tempfile();
print $in $mime->as_string or die "write failed: $!";
$in->flush or die "flush failed: $!";
my $in = tempfile();
print $in $mime->as_string or die "write failed: $!";
$in->flush or die "flush failed: $!";
- $in->seek(0, SEEK_SET);
+ seek($in, 0, SEEK_SET);
my $out = tempfile();
my $pid = spawn(\@cmd, {}, { 0 => $in, 1 => $out });
is(waitpid($pid, 0), $pid, 'waitpid succeeds on hash-object');
is($?, 0, 'hash-object');
my $out = tempfile();
my $pid = spawn(\@cmd, {}, { 0 => $in, 1 => $out });
is(waitpid($pid, 0), $pid, 'waitpid succeeds on hash-object');
is($?, 0, 'hash-object');
- $out->seek(0, SEEK_SET);
+ seek($out, 0, SEEK_SET);
chomp(my $hashed_obj = <$out>);
is($hashed_obj, $info->[0], "last object_id matches exp");
}
chomp(my $hashed_obj = <$out>);
is($hashed_obj, $info->[0], "last object_id matches exp");
}