2008-04-01 Pavel Roskin <proski@gnu.org>
* util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The later is obsolete, potentially dangerous and sets a bad example. * util/i386/efi/grub-mkimage.c (make_header): Likewise. * util/misc.c (grub_util_get_image_size): Likewise.
This commit is contained in:
parent
2bb4fb47e8
commit
828a27686e
4 changed files with 11 additions and 6 deletions
|
@ -1,5 +1,10 @@
|
||||||
2008-04-01 Pavel Roskin <proski@gnu.org>
|
2008-04-01 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The
|
||||||
|
later is obsolete, potentially dangerous and sets a bad example.
|
||||||
|
* util/i386/efi/grub-mkimage.c (make_header): Likewise.
|
||||||
|
* util/misc.c (grub_util_get_image_size): Likewise.
|
||||||
|
|
||||||
* disk/loopback.c (options): Improve help for "--partitions".
|
* disk/loopback.c (options): Improve help for "--partitions".
|
||||||
|
|
||||||
* normal/arg.c (grub_arg_show_help): Fix spacing of the long
|
* normal/arg.c (grub_arg_show_help): Fix spacing of the long
|
||||||
|
|
|
@ -255,8 +255,8 @@ cmd_cmp (char *src, char *dest)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((skip) && (fseek (ff, skip, SEEK_SET)))
|
if ((skip) && (fseeko (ff, skip, SEEK_SET)))
|
||||||
grub_util_error ("fseek error.\n");
|
grub_util_error ("seek error.\n");
|
||||||
|
|
||||||
read_file (src, cmp_hook);
|
read_file (src, cmp_hook);
|
||||||
fclose (ff);
|
fclose (ff);
|
||||||
|
|
|
@ -829,7 +829,7 @@ make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address,
|
||||||
| GRUB_PE32_SCN_MEM_READ);
|
| GRUB_PE32_SCN_MEM_READ);
|
||||||
|
|
||||||
/* Write them out. */
|
/* Write them out. */
|
||||||
if (fseek (out, 0, SEEK_SET) < 0)
|
if (fseeko (out, 0, SEEK_SET) < 0)
|
||||||
grub_util_error ("seek failed");
|
grub_util_error ("seek failed");
|
||||||
|
|
||||||
if (fwrite (&header, sizeof (header), 1, out) != 1
|
if (fwrite (&header, sizeof (header), 1, out) != 1
|
||||||
|
|
|
@ -145,8 +145,8 @@ grub_util_get_image_size (const char *path)
|
||||||
void
|
void
|
||||||
grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp)
|
grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp)
|
||||||
{
|
{
|
||||||
if (fseek (fp, offset, SEEK_SET) == -1)
|
if (fseeko (fp, offset, SEEK_SET) == -1)
|
||||||
grub_util_error ("fseek failed");
|
grub_util_error ("seek failed");
|
||||||
|
|
||||||
if (fread (img, 1, size, fp) != size)
|
if (fread (img, 1, size, fp) != size)
|
||||||
grub_util_error ("read failed");
|
grub_util_error ("read failed");
|
||||||
|
@ -199,7 +199,7 @@ void
|
||||||
grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out)
|
grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out)
|
||||||
{
|
{
|
||||||
grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset);
|
grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset);
|
||||||
if (fseek (out, offset, SEEK_SET) == -1)
|
if (fseeko (out, offset, SEEK_SET) == -1)
|
||||||
grub_util_error ("seek failed");
|
grub_util_error ("seek failed");
|
||||||
if (fwrite (img, 1, size, out) != size)
|
if (fwrite (img, 1, size, out) != size)
|
||||||
grub_util_error ("write failed");
|
grub_util_error ("write failed");
|
||||||
|
|
Loading…
Reference in a new issue