* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Use
grub_util_fd_strerror when using grub_util_fd_*. (grub_util_fd_open_device): Likewise. (grub_util_biosdisk_read): Likewise. (grub_util_biosdisk_write): Likewise. * grub-core/kern/emu/hostdisk_unix.c (grub_util_fd_open): New function. (grub_util_fd_strerror): Likewise. (grub_util_fd_sync): Likewise. (grub_util_fd_close): Likewise. * grub-core/kern/emu/hostdisk_windows.c (grub_util_fd_sync): Likewise. (grub_util_fd_close): Likewise. (grub_util_fd_strerror): Likewise. * include/grub/emu/hostdisk.h (grub_util_fd_close): Make into real function proto rather than macro. (grub_util_fd_sync): Likewise. (grub_util_fd_open): Likewise. (grub_util_fd_strerror): New proto.
This commit is contained in:
parent
e8fd80bc3d
commit
43b1c99d53
5 changed files with 92 additions and 11 deletions
|
@ -29,19 +29,21 @@
|
|||
typedef HANDLE grub_util_fd_t;
|
||||
#define GRUB_UTIL_FD_INVALID INVALID_HANDLE_VALUE
|
||||
#define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID)
|
||||
#define grub_util_fd_close(x) CloseHandle(x)
|
||||
#define grub_util_fd_sync(x) FlushFileBuffers(x)
|
||||
grub_util_fd_t
|
||||
grub_util_fd_open (const char *os_dev, int flags);
|
||||
#else
|
||||
typedef int grub_util_fd_t;
|
||||
#define GRUB_UTIL_FD_INVALID -1
|
||||
#define GRUB_UTIL_FD_IS_VALID(x) ((x) >= 0)
|
||||
#define grub_util_fd_close(x) close(x)
|
||||
#define grub_util_fd_sync(x) fsync(x)
|
||||
#define grub_util_fd_open(x,y) open(x,y)
|
||||
#endif
|
||||
|
||||
grub_util_fd_t
|
||||
grub_util_fd_open (const char *os_dev, int flags);
|
||||
const char *
|
||||
grub_util_fd_strerror (void);
|
||||
void
|
||||
grub_util_fd_sync (grub_util_fd_t fd);
|
||||
void
|
||||
grub_util_fd_close (grub_util_fd_t fd);
|
||||
|
||||
grub_util_fd_t
|
||||
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
|
||||
grub_disk_addr_t *max);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue