Use Winapi on both cygwin and mingw32 to share more code between both.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-09-23 11:21:09 +02:00
parent d68d01573b
commit 7e518ca84f
30 changed files with 1984 additions and 1670 deletions

View file

@ -210,7 +210,7 @@ make_uuid (const struct grub_geli_phdr *header,
char *
grub_util_get_geli_uuid (const char *dev)
{
int fd = open (dev, O_RDONLY);
grub_util_fd_t fd = grub_util_fd_open (dev, O_RDONLY);
grub_uint64_t s;
unsigned log_secsize;
grub_uint8_t hdr[512];
@ -218,7 +218,7 @@ grub_util_get_geli_uuid (const char *dev)
char *uuid;
gcry_err_code_t err;
if (fd < 0)
if (!GRUB_UTIL_FD_IS_VALID (fd))
return NULL;
s = grub_util_get_fd_size (fd, dev, &log_secsize);