* util/grub-mkrescue.c: Fix incorrect file usage in fallback code.

Reported by: Jon McCune
This commit is contained in:
Vladimir Serbinenko 2013-12-17 00:33:55 +01:00
parent dd05b91f6b
commit 6cc8959712
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2013-12-16 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrescue.c: Fix incorrect file usage in fallback code.
Reported by: Jon McCune
2013-12-16 Andrey Borzenkov <arvidjaar@gmail.com>
* grub-core/osdep/linux/platform.c (grub_install_get_default_x86_platform):

View file

@ -509,7 +509,7 @@ main (int argc, char *argv[])
if (!sa)
grub_util_error (_("cannot open `%s': %s"), sysarea_img,
strerror (errno));
bi = grub_util_fopen (sysarea_img, "wb");
bi = grub_util_fopen (bin, "rb");
if (!bi)
grub_util_error (_("cannot open `%s': %s"), bin,
strerror (errno));
@ -519,10 +519,10 @@ main (int argc, char *argv[])
fclose (bi);
fwrite (buf, 1, 512, sa);
grub_install_make_image_wrap (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC],
"/boot/grub", output,
0, load_cfg,
"i386-pc", 0);
grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC],
"/boot/grub", sa, sysarea_img,
0, load_cfg,
"i386-pc", 0);
sz = ftello (sa);
fflush (sa);
grub_util_fd_sync (fileno (sa));