do {
$tmp = _fn_in($self, $pid, 'tmp');
} while (!sysopen($fh, $tmp, O_CREAT|O_EXCL|O_RDWR) and $! == EEXIST);
- print $fh $$strref or die "print: $!";
- $fh->flush or die "flush: $!";
+ print $fh $$strref;
+ $fh->flush or die "$fh->flush: $!";
$self->{fh} = $fh;
$self->{$tmp_key} = $tmp;
}
print $in $buf;
}
# ensure it's visible to git-http-backend(1):
- $in->flush // die "flush: $!";
+ $in->flush or die "$in->flush: $!";
sysseek $in, 0, SEEK_SET;
$in;
}
sub read_prepare {
my ($self) = @_;
my $io = $self->{rd} = delete($self->{wr});
- $io->flush or die "flush: $!";
+ $io->flush or die "$io->flush: $!";
$self;
}
if ($$sref =~ /^(?:diff|---|\+\+\+) /ms && !$PATCHID_BROKEN) {
my $git = ($self->{ibx} // $self->{eidx} // $self)->git;
my $fh = PublicInbox::IO::write_file '+>:utf8', undef, $$sref;
- $fh->flush or die "flush: $!";
+ $fh->flush or die "$fh->flush: $!";
sysseek($fh, 0, SEEK_SET);
$rd = popen_rd($git->cmd(qw(patch-id --stable)), undef,
{ 0 => $fh });
my $mode_a = $di->{mode_a} // '100644';
my $in = tmpfile("update-index.$oid_full") or die "tmpfile: $!";
- print $in "$mode_a $oid_full\t$path_a\0" or die "print: $!";
- $in->flush or die "flush: $!";
+ print $in "$mode_a $oid_full\t$path_a\0";
+ $in->flush or die "$in->flush: $!";
sysseek $in, 0, SEEK_SET;
dbg($self, 'preparing index');
$opt->{"fh.$child_fd"} = $fh; # for read_out_err
if ($child_fd == 0) {
print $fh $$pfd;
- $fh->flush or die "flush: $!";
+ $fh->flush or die "$fh->flush: $!";
sysseek($fh, 0, SEEK_SET);
}
$pfd = fileno($fh);