Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1O2U3j-0006g4-Eq for mharc-grub-devel@gnu.org; Thu, 15 Apr 2010 14:45:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2U3g-0006dz-Bx for grub-devel@gnu.org; Thu, 15 Apr 2010 14:45:00 -0400 Received: from [140.186.70.92] (port=49081 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2U3H-0005Wq-4n for grub-devel@gnu.org; Thu, 15 Apr 2010 14:44:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2U2P-0008UA-Dy for grub-devel@gnu.org; Thu, 15 Apr 2010 14:44:33 -0400 Received: from stallman.rootnode.net ([89.248.165.10]:53811) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2U2P-0008St-7x for grub-devel@gnu.org; Thu, 15 Apr 2010 14:43:41 -0400 Received: from athlon.localnet (chello089077013017.chello.pl [89.77.13.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by stallman.rootnode.net (Exchange) with ESMTP id 540515E9B for ; Thu, 15 Apr 2010 20:43:38 +0200 (CEST) From: Szymon Janc To: The development of GNU GRUB Date: Thu, 15 Apr 2010 20:43:50 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.32-4-686; KDE/4.4.2; i686; ; ) References: <201004082355.28650.szymon@janc.net.pl> <201004112130.17489.szymon@janc.net.pl> In-Reply-To: <201004112130.17489.szymon@janc.net.pl> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_m51xLnJV2jgN05w" Message-Id: <201004152043.50223.szymon@janc.net.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] support for xz compression X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 18:45:01 -0000 --Boundary-00=_m51xLnJV2jgN05w Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Dnia niedziela 11 kwiecie=F1 2010 o 21:30:17 Szymon Janc napisa=B3(a): > Attached is a small fix for xzio read to act in grub way, not posix lik= e. Attached patch fix a nasty seek bug introduced by previous fix.=20 If You are brave enough to test xzio don't forget to apply this fix.=20 --=20 Szymon K. Janc szymon@janc.net.pl // GG: 1383435 --Boundary-00=_m51xLnJV2jgN05w Content-Type: text/x-patch; charset="UTF-8"; name="07b_xzio_fix2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="07b_xzio_fix2.diff" === modified file 'io/xzio.c' --- io/xzio.c 2010-04-10 22:47:20 +0000 +++ io/xzio.c 2010-04-15 18:35:28 +0000 @@ -243,7 +243,7 @@ enum xz_ret xzret; grub_xzio_t xzio = file->data; int offset_lock; - grub_uint8_t current_offset; + grub_off_t current_offset; /* If seek backward need to reset decoder and start from beginning of file. TODO Possible improvement by jumping blocks. */ @@ -257,13 +257,13 @@ grub_file_seek (xzio->file, 0); } + offset_lock = (file->offset == xzio->saved_offset) ? 1 : 0; + current_offset = xzio->saved_offset; + while (len > 0) { xzio->buf.out_size = len >= XZBUFSIZ ? XZBUFSIZ : len; - offset_lock = (file->offset == xzio->saved_offset) ? 1 : 0; - current_offset = xzio->saved_offset; - /* Feed input. */ if (xzio->buf.in_pos == xzio->buf.in_size) { @@ -298,7 +298,7 @@ } else { - grub_uint8_t new_offset = current_offset + xzio->buf.out_pos; + grub_off_t new_offset = current_offset + xzio->buf.out_pos; if (file->offset > new_offset) current_offset = new_offset; --Boundary-00=_m51xLnJV2jgN05w--