2008-02-07 Christian Franke <franke@computer.org>
* util/hostfs.c (grub_hostfs_open): Use fseeko and ftello instead of fseek and ftell to support large files. (grub_hostfs_read): Likewise.
This commit is contained in:
parent
f2156fda69
commit
1ec8425d1d
2 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-02-07 Christian Franke <franke@computer.org>
|
||||
|
||||
* 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 <rmh@aybabtu.com>
|
||||
|
||||
Patch from Jeroen Dekkers.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue