Move OS-specific driver configuration to grub_util_fd_open. This

moves OS-dependent parts from kern/emu/hostdisk.c to
	grub-core/osdep/*/hostdisk.c.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-10-09 07:04:25 +02:00
parent f7676b7016
commit caca1c70cf
13 changed files with 101 additions and 93 deletions

View file

@ -68,7 +68,23 @@ grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsiz
return nr << log_sector_size;
}
void
grub_hostdisk_configure_device_driver (grub_util_fd_t fd __attribute__ ((unused)))
grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags)
{
grub_util_fd_t ret;
#ifdef O_LARGEFILE
flags |= O_LARGEFILE;
#endif
#ifdef O_BINARY
flags |= O_BINARY;
#endif
ret = open (os_dev, flags);
/* If we can't have exclusive access, try shared access */
if (ret < 0)
ret = open (os_dev, flags | O_SHLOCK);
return ret;
}