2008-08-26 Robert Millan <rmh@aybabtu.com>

* util/biosdisk.c (grub_util_biosdisk_open, open_device)
        (grub_util_biosdisk_get_grub_dev): Make error messages a bit more
        descriptive.
This commit is contained in:
robertmh 2008-08-26 19:09:07 +00:00
parent 5ed20adcb9
commit c07ae501cb
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2008-08-26 Robert Millan <rmh@aybabtu.com>
* util/biosdisk.c (grub_util_biosdisk_open, open_device)
(grub_util_biosdisk_get_grub_dev): Make error messages a bit more
descriptive.
2008-08-23 Bean <bean123ch@gmail.com>
* conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c.

View File

@ -164,7 +164,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
fd = open (map[drive].device, O_RDONLY);
if (fd == -1)
return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[drive].device);
return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk size", map[drive].device);
if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode))
{
@ -288,7 +288,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
is_partition = linux_find_partition (dev, disk->partition->start);
/* Open the partition. */
grub_util_info ("opening the device `%s'", dev);
grub_util_info ("opening the device `%s' in open_device()", dev);
fd = open (dev, flags);
if (fd < 0)
{
@ -306,7 +306,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
fd = open (map[disk->id].device, flags);
if (fd < 0)
{
grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[disk->id].device);
grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id].device);
return -1;
}
#endif /* ! __linux__ */
@ -835,7 +835,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
fd = open (os_dev, O_RDONLY);
if (fd == -1)
{
grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", os_dev);
grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk geometry", os_dev);
free (name);
return 0;
}