From f2c6ff15e543341649c10e1929a11c3c660bd8ee Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 14 Dec 2013 21:55:44 +0100 Subject: [PATCH] * grub-core/osdep/windows/hostdisk.c: Fix cygwin compilation. --- ChangeLog | 4 ++++ grub-core/osdep/windows/hostdisk.c | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 249422d4a..d8ffc725e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-14 Vladimir Serbinenko + + * grub-core/osdep/windows/hostdisk.c: Fix cygwin compilation. + 2013-12-14 Vladimir Serbinenko * grub-core/osdep/windows/blocklist.c: Add missing cast in printf diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c index 41ab318c0..984ff2605 100644 --- a/grub-core/osdep/windows/hostdisk.c +++ b/grub-core/osdep/windows/hostdisk.c @@ -48,6 +48,10 @@ #include #include +#ifdef __CYGWIN__ +#include +#endif + #if SIZEOF_TCHAR == 1 LPTSTR @@ -441,7 +445,6 @@ get_temp_name (void) TCHAR *ptr; HCRYPTPROV hCryptProv; grub_uint8_t rnd[5]; - const size_t sz = sizeof (rnd) * GRUB_CHAR_BIT / 5; int i; GetTempPath (ARRAY_SIZE (rt) - 100, rt); @@ -614,6 +617,15 @@ grub_util_is_special_file (const char *name) #else +void +grub_util_file_sync (FILE *f) +{ + fflush (f); + if (!allow_fd_syncs) + return; + fsync (fileno (f)); +} + FILE * grub_util_fopen (const char *path, const char *mode) { @@ -625,7 +637,7 @@ grub_util_is_special_file (const char *path) { struct stat st; - if (lstat (destnew, &st) == -1) + if (lstat (path, &st) == -1) return 1; return (!S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)); }