2009-11-11 Robert Millan <rmh.grub@aybabtu.com>

Large file support for grub-mkisofs.

        * conf/common.rmk (grub_mkisofs_CFLAGS): Add `-D_FILE_OFFSET_BITS=64'.
        * util/mkisofs/mkisofs.c (next_extent, last_extent)
        (session_start): Upgrade type to `uint64_t'.  Update all users.
        * util/mkisofs/mkisofs.h: Include `<stdint.h>'.
        (struct directory_entry): Upgrade type of `starting_block' and
        `size' to `uint64_t'.  Update all users.
        (struct deferred): Remove unused structure.
        (xfwrite): Upgrade type of `count' and `size' to `uint64_t'.
        Update all users.
        * util/mkisofs/tree.c (stat_filter, lstat_filter): Return -1 when
        file is larger than `UINT32_MAX'.
        * util/mkisofs/write.c (xfwrite): Upgrade type of `count' and
        `size' to `uint64_t'.  Update all users.  Fix handling of fwrite()
        return value.
        (struct deferred_write): Upgrade type of `extent' and `size' to
        `uint64_t'.  Update all users.
        (last_extent_written): Upgrade type to `uint64_t'.  Update all
        users.
        (write_one_file): Upgrade type of `count' and `size' to `uint64_t'.
        Update all users.  Upgrade type of `remain' to `int64_t' and
        `use' to `size_t'.  Use error() to handle fread() errors.
        (write_files): Rely on write_one_file() rather than calling
        xfwrite() directly.
This commit is contained in:
Robert Millan 2009-11-11 00:23:29 +00:00
parent 6a9cead5cf
commit 2c55dbc0d5
6 changed files with 76 additions and 48 deletions

View file

@ -6,9 +6,11 @@
Copyright 1993 Yggdrasil Computing, Incorporated
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
@ -17,7 +19,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, see <http://www.gnu.org/licenses/>.
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
static char rcsid[] ="$Id: tree.c,v 1.29 1999/03/07 17:41:19 eric Exp $";
@ -141,6 +143,10 @@ FDECL2(stat_filter, char *, path, struct stat *, st)
int result = stat(path, st);
if (result >= 0 && rationalize)
stat_fix(st);
if ((unsigned) st->st_size > UINT32_MAX)
result = -1;
return result;
}
@ -150,6 +156,10 @@ FDECL2(lstat_filter, char *, path, struct stat *, st)
int result = lstat(path, st);
if (result >= 0 && rationalize)
stat_fix(st);
if ((unsigned) st->st_size > UINT32_MAX)
result = -1;
return result;
}