]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/osdep/windows/hostdisk.c: Fix cygwin compilation.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 14 Dec 2013 20:55:44 +0000 (21:55 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 14 Dec 2013 20:55:44 +0000 (21:55 +0100)
ChangeLog
grub-core/osdep/windows/hostdisk.c

index 249422d4a60ceb312dde7c7b4e927fe67df0c8f2..d8ffc725efe8f37c516444c3b0cec048ac07e114 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/osdep/windows/hostdisk.c: Fix cygwin compilation.
+
 2013-12-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/osdep/windows/blocklist.c: Add missing cast in printf
index 41ab318c0ba54ab0d5325b9109fb91961f524436..984ff26055d9dbe8c92607afb689484c29dcde0d 100644 (file)
 #include <winioctl.h>
 #include <wincrypt.h>
 
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#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));
 }