+2011-04-10 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_data): New member
+ is_disk.
+ (grub_util_biosdisk_open): Don't apply ioctl on non-disk devices.
+ (open_device) Likewise.
+ (grub_util_biosdisk_close): Likewise.
+ Reported by: Mark Korenberger.
+
2011-04-10 Alexander Kurtz <kurtz.alex@googlemail.com>
* util/grub-mkconfig_lib.in: Add missing quotes.
char *dev;
int access_mode;
int fd;
+ int is_disk;
};
#ifdef __linux__
data->dev = NULL;
data->access_mode = 0;
data->fd = -1;
+ data->is_disk = 0;
/* Get the size. */
#if defined(__MINGW32__)
close (fd);
goto fail;
}
+ data->is_disk = 1;
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (ioctl (fd, DIOCGMEDIASIZE, &nr))
{
fsync (data->fd);
#ifdef __linux__
- ioctl (data->fd, BLKFLSBUF, 0);
+ if (data->is_disk)
+ ioctl (data->fd, BLKFLSBUF, 0);
#endif
}
{
fsync (data->fd);
#ifdef __linux__
- ioctl (data->fd, BLKFLSBUF, 0);
+ if (data->is_disk)
+ ioctl (data->fd, BLKFLSBUF, 0);
#endif
}
close (data->fd);
{
fsync (data->fd);
#ifdef __linux__
- ioctl (data->fd, BLKFLSBUF, 0);
+ if (data->is_disk)
+ ioctl (data->fd, BLKFLSBUF, 0);
#endif
}
close (data->fd);