From 6b4085ee24b0d946acb85f60f4dbfdeaa7bd75b3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 17 Oct 2023 23:38:14 +0000 Subject: convert: use read_all to simplify error checks There wasn't a need to loop anyways with Perl `read' since the default PerlIO layer will retry. --- script/public-inbox-convert | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'script') diff --git a/script/public-inbox-convert b/script/public-inbox-convert index 0cc52777..96f6d2ea 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -130,14 +130,8 @@ while (<$rd>) { } elsif (/^commit /) { $state = 'commit'; } elsif (/^data ([0-9]+)/) { - my $len = $1; print $io $_ or $im->wfail; - while ($len) { - my $n = read($rd, my $tmp, $len) or die "read: $!"; - warn "$n != $len\n" if $n != $len; - $len -= $n; - print $io $tmp or $im->wfail; - } + print $io PublicInbox::Git::read_all($rd, $1) or $im->wfail; next; } elsif ($state eq 'commit') { if (m{^M 100644 :([0-9]+) (${h}{2}/${h}{38})}o) { -- cgit v1.2.3-24-ge0c7