From: espie Date: Sat, 27 May 2023 10:07:33 +0000 (+0000) Subject: comment/cosmetic X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d9c6c4f73f0c113e4eff174db28ec8c55ce19289;p=openbsd comment/cosmetic --- diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm index bb958cbdd16..608668eba2c 100644 --- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm +++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Ustar.pm,v 1.94 2023/05/16 16:55:32 espie Exp $ +# $OpenBSD: Ustar.pm,v 1.95 2023/05/27 10:07:33 espie Exp $ # # Copyright (c) 2002-2014 Marc Espie # @@ -901,8 +901,8 @@ sub write_contents my $filename = $self->{realname}; my $size = $self->{size}; my $out = $arc->{fh}; - open my $fh, "<", $filename or $self->_fatal("Can't read file #1: #2", - $filename, $!); + open my $fh, "<", $filename or + $self->_fatal("Can't read file #1: #2", $filename, $!); my $buffer; my $toread = $size; @@ -923,6 +923,7 @@ sub write_contents $toread -= $actual; $self->_left_todo($toread); } + # explicitly pad archive to 512 bytes blocksize if ($size % 512) { print $out "\0" x (512 - $size % 512) or $self->_fatal("Error writing to archive: #1", $!); @@ -953,6 +954,7 @@ sub copy_contents $toread -= $actual; } + # explicitly pad archive to 512 bytes blocksize if ($size % 512) { print $out "\0" x (512 - $size % 512) or $self->_fatal("Error writing to archive: #1", $!);