From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JNDwc-0008Qv-0b for mharc-grub-devel@gnu.org; Thu, 07 Feb 2008 16:06:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNDwa-0008Ou-DP for grub-devel@gnu.org; Thu, 07 Feb 2008 16:06:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNDwY-0008N8-Nw for grub-devel@gnu.org; Thu, 07 Feb 2008 16:06:03 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNDwY-0008N5-Ku for grub-devel@gnu.org; Thu, 07 Feb 2008 16:06:02 -0500 Received: from mailout03.sul.t-online.de ([194.25.134.81] helo=mailout03.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNDwY-00045h-7m for grub-devel@gnu.org; Thu, 07 Feb 2008 16:06:02 -0500 Received: from fwd30.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1JNDwW-0007Sb-05; Thu, 07 Feb 2008 22:06:00 +0100 Received: from [10.3.2.2] (X6Egh4ZbYh4l3kI9ht97SXyBZ2VrAOegcbQkAg5n+Evtn04+qCif08+8V8OpTDVZ08@[217.235.193.69]) by fwd30.aul.t-online.de with esmtp id 1JNDwO-0fv8Gu0; Thu, 7 Feb 2008 22:05:52 +0100 Message-ID: <47AB72B4.2070909@t-online.de> Date: Thu, 07 Feb 2008 22:05:56 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------080808030700040908010404" X-ID: X6Egh4ZbYh4l3kI9ht97SXyBZ2VrAOegcbQkAg5n+Evtn04+qCif08+8V8OpTDVZ08 X-TOI-MSGID: d8df6ea5-ac0b-405b-af5a-b71f024d8c89 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] Large image file support for grub-fstest X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 21:06:04 -0000 This is a multi-part message in MIME format. --------------080808030700040908010404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The new command "grub-fstest" may not work for large image files or /dev/sdX devices on 32-bit platforms. Legacy C89 functions fseek() and ftell() always use "long" as offset type. The attached patch changes this to fseeko() and ftello() which use off_t. These are part of POSIX, so new ./configure stuff should be not necessary. Christian 2008-02-07 Christian Franke * util/hostfs.c (grub_hostfs_open): Use fseeko and ftello instead of fseek and ftell to support large files. (grub_hostfs_read): Likewise. --------------080808030700040908010404 Content-Type: text/x-patch; name="grub2-hostfs-largefile.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-hostfs-largefile.patch" --- grub2.orig/util/hostfs.c 2007-11-18 17:57:02.531250000 +0100 +++ grub2/util/hostfs.c 2008-02-07 21:44:25.531250000 +0100 @@ -100,9 +100,9 @@ grub_hostfs_open (struct grub_file *file "can't open `%s'", name); file->data = f; - fseek (f, 0, SEEK_END); - file->size = ftell (f); - fseek (f, 0, SEEK_SET); + fseeko (f, 0, SEEK_END); + file->size = ftello (f); + fseeko (f, 0, SEEK_SET); return GRUB_ERR_NONE; } @@ -113,7 +113,7 @@ grub_hostfs_read (grub_file_t file, char FILE *f; f = (FILE *) file->data; - fseek (f, file->offset, SEEK_SET); + fseeko (f, file->offset, SEEK_SET); int s = fread (buf, 1, len, f); return s; --------------080808030700040908010404--