diff --git a/ChangeLog b/ChangeLog index 5904dd993..3ce2e2aa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. + 2008-02-07 Robert Millan Patch from Jeroen Dekkers. diff --git a/util/hostfs.c b/util/hostfs.c index e8dc59695..2d9b7bed5 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -100,9 +100,9 @@ grub_hostfs_open (struct grub_file *file, const char *name) "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 *buf, grub_size_t len) 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;