* grub-core/osdep/windows/hostdisk.c: Fix cygwin compilation.

This commit is contained in:
Vladimir Serbinenko 2013-12-14 21:55:44 +01:00
parent 6b8a162516
commit f2c6ff15e5
2 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -48,6 +48,10 @@
#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));
}