From: Vladimir 'phcoder' Serbinenko Date: Wed, 15 Sep 2010 22:27:06 +0000 (+0200) Subject: * util/grub-setup.c (setup): Fix incorrect container semantics. X-Git-Tag: 1.99~499 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb731b5e81d006e367414a592f7ca7b2ccddadd4;p=thirdparty%2Fgrub.git * util/grub-setup.c (setup): Fix incorrect container semantics. --- diff --git a/ChangeLog b/ChangeLog index 0b3d7627c..0696c38b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-09-15 Vladimir Serbinenko + + * util/grub-setup.c (setup): Fix incorrect container semantics. + 2010-09-15 Vladimir Serbinenko * grub-core/commands/parttool.c (grub_cmd_parttool): Fix a variable diff --git a/util/grub-setup.c b/util/grub-setup.c index c9ab5cfdb..1bf0d958d 100644 --- a/util/grub-setup.c +++ b/util/grub-setup.c @@ -333,7 +333,7 @@ setup (const char *dir, #ifdef GRUB_MACHINE_PCBIOS { grub_partition_map_t dest_partmap = NULL; - grub_partition_map_t container = dest_dev->disk->partition; + grub_partition_t container = dest_dev->disk->partition; int multiple_partmaps = 0; grub_err_t err; grub_disk_addr_t sectors[core_sectors]; @@ -454,11 +454,6 @@ setup (const char *dir, : GRUB_DISK_SECTOR_SIZE, core_img + i * GRUB_DISK_SECTOR_SIZE); - /* Write the boot image onto the disk. */ - if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, - boot_img)) - grub_util_error ("%s", grub_errmsg); - goto finish; } #endif @@ -630,12 +625,13 @@ unable_to_embed: grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE * 2, fp); fclose (fp); + finish: + /* Write the boot image onto the disk. */ if (grub_disk_write (dest_dev->disk, BOOT_SECTOR, 0, GRUB_DISK_SECTOR_SIZE, boot_img)) grub_util_error ("%s", grub_errmsg); - finish: /* Sync is a Good Thing. */ sync ();