From 828a27686eab031725ceeb2f4b13a1f9a47739c4 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 01:49:18 +0000 Subject: [PATCH] 2008-04-01 Pavel Roskin * 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. --- ChangeLog | 5 +++++ util/grub-fstest.c | 4 ++-- util/i386/efi/grub-mkimage.c | 2 +- util/misc.c | 6 +++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a5b44bc6..04211e958 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-01 Pavel Roskin + * 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". * normal/arg.c (grub_arg_show_help): Fix spacing of the long diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 126a2307a..39f409664 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -255,8 +255,8 @@ cmd_cmp (char *src, char *dest) return; } - if ((skip) && (fseek (ff, skip, SEEK_SET))) - grub_util_error ("fseek error.\n"); + if ((skip) && (fseeko (ff, skip, SEEK_SET))) + grub_util_error ("seek error.\n"); read_file (src, cmp_hook); fclose (ff); diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index d86bde370..57c1fc88d 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -829,7 +829,7 @@ make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address, | GRUB_PE32_SCN_MEM_READ); /* Write them out. */ - if (fseek (out, 0, SEEK_SET) < 0) + if (fseeko (out, 0, SEEK_SET) < 0) grub_util_error ("seek failed"); if (fwrite (&header, sizeof (header), 1, out) != 1 diff --git a/util/misc.c b/util/misc.c index 92eea95c5..f3b94c6c1 100644 --- a/util/misc.c +++ b/util/misc.c @@ -145,8 +145,8 @@ grub_util_get_image_size (const char *path) void grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp) { - if (fseek (fp, offset, SEEK_SET) == -1) - grub_util_error ("fseek failed"); + if (fseeko (fp, offset, SEEK_SET) == -1) + grub_util_error ("seek failed"); if (fread (img, 1, size, fp) != size) 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_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"); if (fwrite (img, 1, size, out) != size) grub_util_error ("write failed");