2008-04-01 Pavel Roskin <proski@gnu.org>
* disk/ata.c (grub_ata_open): Don't lose precision in disk->id. * disk/host.c (grub_host_open): Likewise. * disk/loopback.c (grub_loopback_open): Likewise. * disk/memdisk.c (grub_memdisk_open): Use a string pointer for disk->id as in disk/host.c, not a multi-character constant.
This commit is contained in:
parent
828a27686e
commit
4b6e1995be
5 changed files with 10 additions and 4 deletions
|
@ -1,5 +1,11 @@
|
||||||
2008-04-01 Pavel Roskin <proski@gnu.org>
|
2008-04-01 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* disk/ata.c (grub_ata_open): Don't lose precision in disk->id.
|
||||||
|
* disk/host.c (grub_host_open): Likewise.
|
||||||
|
* disk/loopback.c (grub_loopback_open): Likewise.
|
||||||
|
* disk/memdisk.c (grub_memdisk_open): Use a string pointer for
|
||||||
|
disk->id as in disk/host.c, not a multi-character constant.
|
||||||
|
|
||||||
* util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The
|
* util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The
|
||||||
later is obsolete, potentially dangerous and sets a bad example.
|
later is obsolete, potentially dangerous and sets a bad example.
|
||||||
* util/i386/efi/grub-mkimage.c (make_header): Likewise.
|
* util/i386/efi/grub-mkimage.c (make_header): Likewise.
|
||||||
|
|
|
@ -615,7 +615,7 @@ grub_ata_open (const char *name, grub_disk_t disk)
|
||||||
else
|
else
|
||||||
disk->total_sectors = dev->size;
|
disk->total_sectors = dev->size;
|
||||||
|
|
||||||
disk->id = (int) dev;
|
disk->id = (unsigned long) dev;
|
||||||
|
|
||||||
disk->has_partitions = !dev->atapi;
|
disk->has_partitions = !dev->atapi;
|
||||||
disk->data = dev;
|
disk->data = dev;
|
||||||
|
|
|
@ -41,7 +41,7 @@ grub_host_open (const char *name, grub_disk_t disk)
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk");
|
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk");
|
||||||
|
|
||||||
disk->total_sectors = 0;
|
disk->total_sectors = 0;
|
||||||
disk->id = (int) "host";
|
disk->id = (unsigned long) "host";
|
||||||
|
|
||||||
disk->has_partitions = 0;
|
disk->has_partitions = 0;
|
||||||
disk->data = 0;
|
disk->data = 0;
|
||||||
|
|
|
@ -177,7 +177,7 @@ grub_loopback_open (const char *name, grub_disk_t disk)
|
||||||
/* Use the filesize for the disk size, round up to a complete sector. */
|
/* Use the filesize for the disk size, round up to a complete sector. */
|
||||||
disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1)
|
disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1)
|
||||||
/ GRUB_DISK_SECTOR_SIZE);
|
/ GRUB_DISK_SECTOR_SIZE);
|
||||||
disk->id = (int) dev;
|
disk->id = (unsigned long) dev;
|
||||||
|
|
||||||
disk->has_partitions = dev->has_partitions;
|
disk->has_partitions = dev->has_partitions;
|
||||||
disk->data = file;
|
disk->data = file;
|
||||||
|
|
|
@ -41,7 +41,7 @@ grub_memdisk_open (const char *name, grub_disk_t disk)
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a memdisk");
|
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a memdisk");
|
||||||
|
|
||||||
disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE;
|
disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE;
|
||||||
disk->id = (int) 'mdsk';
|
disk->id = (unsigned long) "mdsk";
|
||||||
disk->has_partitions = 0;
|
disk->has_partitions = 0;
|
||||||
|
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
Loading…
Reference in a new issue